How do I format a date merge field in DocuSign for Salesforce?
DocuSign dates are formatted as yyyy-mm-dd when creating date merge fields from Salesforce.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 Date, CloseDate__c FROM Opportunity WHERE Id = '0061a000003oDge'
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, signers expect the date in a certain format.
- Create formula fields from Salesforce
- Remap merge fields to point to the new formula fields
Building Formula Fields
Add a new custom formula field to Salesforce opportunity objects.
- In Salesforce go to "Setup".
- Go to the "Build" Section and select "Customize".
- Under Opportunity select "fields" and click on the "New" button.
- Choose "Formula" as Data Type, click "Next".
- Select "Text" for the output Type, Enter a "Field Label" and "Field Name", click "Next"
- Select the "Advanced Formula" tab and type the formula below:
text(DAY( TODAY() )) +'/'+ text(MONTH( TODAY() )) +'/'+ text(YEAR( TODAY() ))
United States Format:
text(MONTH( TODAY() )) +'/'+ text(DAY( TODAY() )) +'/'+ text(YEAR( TODAY() ))
Note: This sample is using TODAY() as the date field but you can replace TODAY() with the desired field. For Instance CloseDate is one of the default date field for Opportunity. The following example takes CloseDate and converted in format DD/MM/YYYY.
text(DAY( CloseDate )) +'/'+ text(MONTH( CloseDate )) +'/'+ text(YEAR( CloseDate ))
United States Format
text(MONTH( CloseDate )) +'/'+ text(DAY( CloseDate )) +'/'+ text(YEAR( CloseDate ))
- Make it available for the desired "Security Profile", click "Next" (use default for testing purpose)
- Select the layout you wish to default the custom fields (field is Read Only)
- Click Save & New to populate the new field into all your opportunity objects
Create a custom merge fields tag in DocuSign, related to the newly created formula field.
- In Salesforce, go to the DocuSign Admin Tab and select the DocuSign link to Log into DocuSign.
- Go to "Preferences" > "Custom Tags" > "Add".
- Check "Relate to Salesforce" box.
- Select the Salesforce object.
- Select the Salesforce custom formula field.
- Label it and Save.
If your merge fields are added to templates. Delete the merge fields and add back in from your "custom" tag list.