Truncating Comments Pushed to Salesforce

  • 3 February 2016
  • 6 replies

Userlevel 7
Badge +5
  • Gainsight Employee: Golden Ruler
  • 319 replies
Everyone here does not have access to Gainsight yet. There are some fields we push from Gainsight to Salesforce for visibility to different teams. However, the field in Salesforce has a 250 character limit. The limit in the scorecard field of Gainsight is a lot larger. 

Because of this it cause the rule pushing to Salesforce to fail for any comments longer than 250 characters. Can we implement a character limit on the field in Gainsight or setup a right trim when the comment is pushed to Salesforce?

Or if you have another suggestion, that would be great!

6 replies

Userlevel 5
It involves creating a formula field on Gainsight's  Scorecard Fact object if that is fine.

Formula would be something like TRIM(LEFT(JBCXM__CurComment__c,250))

Pull this field when you sync with SFDC object.
Userlevel 7
Badge +5
Hi Sundar,

Thanks for the reply. When I try to create the field in the Scorecard Fact object, I get this error:

Error: You referenced an unsupported field type called "Long Text Area" using the following field: JBCXM__CurComment__c

Do you know another way around this? I tried modifying how many characters were allowed in the CurComment field, but SFDC said it's a managed field I cannot change.
I tested this as well, and SFDC doesn't allow formula fields off of long text area field types.  Is it possible to write a Flow to push this data to SFDC Lane?
Userlevel 7
Badge +5
Hey Scott, 

What type of Flow? We have a rule to push this to SFDC. The issue is the field it needs to populate has a 250 character limit. Because of this, the rule partially fails for any comment over 250 characters. The solutions we've thought of are:

  1. Create a Trim that truncates the comment to 250 characters.
  2. Change the field in GS to limit to 250 characters.
  3. Any other ideas some one comes up with for us to try.
Hi Lane:

1.  Set up a custom field on Scorecard Fact object that is a text type with a character limit of 255:

2.  Create a Workflow Rule off of the Scorecard Fact object

3.  Make Criteria of the Rule JBCXM__CurComment__c != null

4.  In the Action of the Rule, have it update the new custom field.  Make sure to use the same comment:

TRIM(LEFT(JBCXM__CurComment__c , 255))

This will truncate the comments at 255 characters to the new field.

5.   You can see the report truncates the values from the Scorecard Fact comment field.  Photo of a report showing field values in custom field as well as the actual values on the Scorecard (longer than 255 characters). 

Let me know if this solves the use case or if you have any questions.
Userlevel 7
Badge +5
Thanks Scott! This worked for us!