DocuSign eSignature for Salesforce - How to write a date back to Salesforce

This article pertains to DocuSign eSignature for Salesforce.


I want a signer to enter a date in DD/MM/YYYY format and have that data write back to Salesforce into a Date field suitable for reporting.

Note that if you are trying to format a date from Salesforce in to a DocuSign envelope, a guide is available here.


Custom fields need to be created in Salesforce: The data must be written back to a Text field. A Formula field can then be used to process it into a Salesforce-readable date.

In Salesforce

  1. Navigate to Setup > Object Manager.
  2. Select the object you're working with. Under the object you will be writing back to, select Fields & Relationships then New in the Custom Fields section.
  3. Create a Text field, enter a Field Label and Field Name as appropriate (Example: CloseDateText).
  4. Establish Field-Level Security and Layouts as appropriate. The DocuSign Connect user profile will need Visible access to the field to create the Merge Field in DocuSign.
  5. Select Save & New.
  6. Select Data Type: Formula.
  7. Select Output type: Date and enter a Field Label and Field Name (Example:CloseDateFormatted).
  8. Enter the following Advanced Formula, replacing CloseDateText with the field name used for the text field:


/* DATE function uses YYYY MM DD format */

/* Swap middle and bottom sections if using American date format *\

/* Year Logic */

VALUE(RIGHT(CloseDateText__c, 4)),

/* Month Logic */


FIND("/",CloseDateText__c) + 1,

FIND("/",CloseDateText__c, FIND("/",CloseDateText__c) + 1) -

FIND("/",CloseDateText__c) - 1


/* Day Logic */


FIND("/",CloseDateText__c) - 1))


  1. Establish Field-level Security as appropriate. Field will always be Read-Only, but should be visible to anyone who will need read access to it.
  2. Add to Layouts as desired

Once the fields are added to the Salesforce object, you will need to create a Merge Field in DocuSign to write back to the text field. You can either do this by logging in to DocuSign directly, or from the Custom Tags section available in the DocuSign Admin panel.

In DocuSign:

  1. Navigate to Settings > Document Custom Fields > Add Field.
  2. Enter a Name.
  3. Check Relate Field To Salesforce.
  4. In the dropdown, select the Object (Example: Opportunity(Reference)) and the DateText field you created previously.
  5. Check Allow Writeback, leave Type as Text Field.
  6. Set Required, Read Only, Shared and Formatting properties as desired.
  7. Change Validation to Regular Expression. Use the following RegEx Pattern to enforce DD/MM/YYYYY format:


  1. Fill in Error Message and Tooltip as desired.
  2. Enter an Anchor Text string if one is to be used.
  3. Save the custom field. If you will be using it in a template, place it where appropriate.