DocuSign for Salesforce: Merge Fields From Currency and Number Fields Do Not Contain Commas

When creating merge fields, commas are not populated into DocuSign tags when mapped from a currency or number field from Salesforce.

Salesforce.com View:

Salesforce Currency & Number Fields


Output from DocuSign:
Output from DocuSign merge field

As you can see, no commas are added in the values. Also, for the currency data, it does not contain commas or the dollar sign like it does in the Salesforce interface.
 

Why Does This Happen?


DocuSign is not formatting the value after it is received from Salesforce. Running the following SOQL query displays the true data values from the Salesforce database.

SELECT Amount,Number_Field__c FROM Opportunity WHERE Id = '0061a000003oDge'
 
 AmountNumber_Field__c
1150000.010000.0
 

Why Address This Problem?

It is simple formatting that some may overlook and question that the effort isn't worth the reward. However, when reviewing agreements or contracts for example, having commas within the number can help eliminate misinterpreting the dollar amount. One may argue, verifying a contract value containing two commas is easier to categorize as a large contract than counting 6 trailing zero's.
 

Solution:

  1. Create formula fields from Salesforce
  2. Remap merge fields to point to the new formula fields​
 

Pre-Requirements:

  1. Building Formula Fields
  2. Create Merge Fields for Users - DocuSign for Salesforce
 

Building Formula Fields


Currency Salesforce Field:

I was able to find a Salesforce developer article to address this same issue for a currency field.
https://developer.salesforce.com/forums/?id=906F00000008utHIAQ

Example Formula:
IF(Amount < 0, "(", "") & "$" &
IF(ABS(Amount) >= 1000000, TEXT(FLOOR(ABS(Amount) / 1000000)) & ",", "") &
IF(ABS(Amount) >= 1000, RIGHT(TEXT(FLOOR(ABS(Amount) / 1000)), 3) & ",", "") &
RIGHT(TEXT(FLOOR(ABS(Amount))), 3) & "." &
IF(MOD(ABS(Amount) , 1) * 100 < 10, "0" & TEXT(ROUND(MOD(ABS(Amount) , 1), 2) * 100), TEXT(MIN(ROUND(MOD(ABS(Amount) , 1), 2) * 100, 99))) &
IF(Amount < 0, ")", "")
 
 

Number Salesforce Field:

Source: https://success.salesforce.com/answers?id=90630000000gpInAAI

Example Formula:
CASE(LEN(TEXT( Number_Field__c )),
1, TEXT(Number_Field__c),
2, TEXT(Number_Field__c),
3, TEXT(Number_Field__c),
4, LEFT(TEXT(Number_Field__c), 1) & "," & RIGHT(TEXT(Number_Field__c), 3),
5, LEFT(TEXT(Number_Field__c), 2) & "," & RIGHT(TEXT(Number_Field__c), 3),
6, LEFT(TEXT(Number_Field__c), 3) & "," & RIGHT(TEXT(Number_Field__c), 3),
7, LEFT(TEXT(Number_Field__c), 1) & "," & MID(TEXT(Number_Field__c), 2,3) & "," & RIGHT(TEXT(Number_Field__c), 3),
8, LEFT(TEXT(Number_Field__c), 2) & "," & MID(TEXT(Number_Field__c), 3,3) & "," & RIGHT(TEXT(Number_Field__c), 3),
9, LEFT(TEXT(Number_Field__c), 3) & "," & MID(TEXT(Number_Field__c), 4,3) & "," & RIGHT(TEXT(Number_Field__c), 3),
10, LEFT(TEXT(Number_Field__c), 1) & "," & MID(TEXT(Number_Field__c), 2,3) & "," & MID(TEXT(Number_Field__c), 5, 3) & "," & RIGHT(TEXT(Number_Field__c), 3),
11, LEFT(TEXT(Number_Field__c), 2) & "," & MID(TEXT(Number_Field__c), 3,3) & "," & MID(TEXT(Number_Field__c), 6, 3) & "," & RIGHT(TEXT(Number_Field__c), 3),
12, LEFT(TEXT(Number_Field__c), 3) & "," & MID(TEXT(Number_Field__c), 4,3) & "," & MID(TEXT(Number_Field__c), 7, 3) & "," & RIGHT(TEXT(Number_Field__c), 3),
null)
 
 

Remap Merge Fields:

Since the data you are attempting to pull is now located at a different field, you now need to reference this new formula field. Example below is when the original field was "Amount" from Salesforce.

Log into DocuSign:
  1. Preferences
  2. Custom Tags
  3. Select merge field tag to update
  4. Change to the formula field name
docusign merge field mapped to opportunity amount     User-added image

If your merge fields are added to templates. Delete the merge fields and add back in from your "custom" tag list.

 

Results:


User-added image


Author: Derrick Tran - Sr. Product Consultant - Professional Services 3/23/2016