7.8 KiB
| title |
|---|
| Migrate DocuSign templates from Sandbox to Production using DAL export (Salesforce) |
Migrate DocuSign templates from Sandbox to Production — DAL (DocuSign Apps Launcher) export
Purpose
- Use DocuSign's DAL template export/import to preserve Salesforce merge fields embedded in the DocuSign-for-Salesforce templates (
dfsle__EnvelopeConfiguration__c). - This document covers exporting templates via DAL from Demo/Sandbox, importing into Production, capturing new template IDs, and updating Salesforce
dfsle__EnvelopeConfiguration__crecords. - Includes instructions to create the
Short_Name__ccustom field required by our Apex classes and Flow.
Prerequisites
- DocuSign admin access (Demo/Sandbox + Production) with permission to export/import templates via DAL.
- Salesforce admin access to create fields and run Data Loader /
sfdxcommands. dfsle(DocuSign for Salesforce) managed package installed in Production.- Optional:
sfdxCLI or Data Loader for bulk CSV updates.
High-level steps
- Export the DocuSign templates from Sandbox/Demo using DAL export.
- Import the DAL package(s) into DocuSign Production.
- Capture the new DocuSign template IDs for each imported template.
- Create the
Short_Name__ccustom field ondfsle__EnvelopeConfiguration__c(if missing). - Prepare CSV mapping old→new template IDs.
- Update (or insert duplicates of)
dfsle__EnvelopeConfiguration__crecords in Salesforce. - Validate by sending test envelopes through the Flow/Apex.
Detailed steps
- Download templates from the source Salesforce org (DAL)
-
Preconditions: you must have Salesforce and DocuSign admin permissions and DAL (DocuSign Apps Launcher v4.5+) installed in the org.
-
Steps in the source org:
- Open the Salesforce App Launcher (grid icon) and select View All.
- Select DocuSign Apps Launcher.
- In the left column select eSignature to open the eSignature Configuration page.
- On the eSignature Configuration page, locate the list of Envelope Templates.
- Select the checkbox next to each template you want to download.
- From the Create Template dropdown choose Download Template.
- The page will refresh and show "Templates downloaded". Save the downloaded file(s) (ZIP) to your device.
- Note: Salesforce prevents downloading templates larger than 4 MB.
-
Important: templates that include custom fields created by a specific user may not import cleanly into the destination org unless that creating user exists in the destination. Either add the creating user to the destination org before upload, or plan to rebuild the missing custom fields after import.
- Import DAL package(s) into DocuSign Production
- In DocuSign Production, go to the Templates (or Template Management) area and use the Import or Upload DAL package option.
- Upload each DAL package file exported from Sandbox/Demo.
- After import, open each imported template and verify that merge fields (placeholders) are preserved and that the template content looks correct.
- Capture new template IDs (GUIDs)
- For each imported template record in Production, record the new template ID (GUID). The template ID is often visible in the template URL (e.g.,
/templates/{templateId}) or in the template properties. - Create a simple mapping list with columns:
OldDocuSignId, NewDocuSignId, TemplateName.
- Create
Short_Name__condfsle__EnvelopeConfiguration__c(if not present)
Why: Our Apex and Flow expect a Short_Name__c field as a compact identifier. Create it before inserting/updating records so Short_Name__c values can be included in CSVs and UI pages.
UI steps (recommended):
- In Salesforce Setup, open Object Manager.
- Search for Envelope Configuration (DocuSign) or look up
dfsle__EnvelopeConfiguration__c. - Click Fields & Relationships → New.
- Select Text → Next.
- Label:
Short Name→ API Name will beShort_Name__c→ Length:50→ Next. - Set Field-Level Security (visible to integration/admin profiles) → Next → Save.
Managed-package note
- Adding custom fields to managed-package objects is supported in subscriber orgs; the custom field's API name will be
Short_Name__c(no package namespace).
MDAPI (optional automation)
- If you prefer to deploy the field via Metadata API, create a field metadata file:
<?xml version="1.0" encoding="UTF-8"?>
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
<fullName>Short_Name__c</fullName>
<label>Short Name</label>
<type>Text</type>
<length>50</length>
<inlineHelpText>Short identifier used by Apex and Flow</inlineHelpText>
</CustomField>
Place that at deploy/mdapi/objects/dfsle__EnvelopeConfiguration__c/fields/Short_Name__c.field-meta.xml and add the file to deploy/mdapi/package.xml before an sfdx force:mdapi:deploy.
- Prepare mapping CSV (old → new)
- For updating existing Salesforce records (recommended if Flows reference record Ids):
Id,dfsle__DocuSignId__c
00Nxxxxxxxxxxxx,AAAAAAAA-BBBB-CCCC-DDDD-111111111111
00Nyyyyyyyyyyyy,22222222-3333-4444-5555-666666666666
- For inserting duplicates (preserve old configs):
Name,Short_Name__c,dfsle__DocuSignId__c,dfsle__EmailMessage__c
Invoice Template - EN,INV_EN,AAAAAAAA-BBBB-CCCC-DDDD-111111111111,Please sign the attached invoice
- Update or insert
dfsle__EnvelopeConfiguration__crecords in Salesforce
- Update (in-place):
# update by Id (bulk upsert)
sfdx force:data:bulk:upsert -s dfsle__EnvelopeConfiguration__c -f updates.csv -i Id -u ORG_ALIAS -w 10
- Insert (duplicates):
sfdx force:data:bulk:insert -s dfsle__EnvelopeConfiguration__c -f inserts.csv -u ORG_ALIAS -w 10
- Alternatively use Data Loader / Dataloader.io for GUI-driven imports.
Notes
- If flows or other automation reference the
dfsle__EnvelopeConfiguration__crecord Ids directly, prefer updatingdfsle__DocuSignId__cin-place. - If you want to keep previous configs for rollback or comparison, insert duplicates and then re-point any automation to new records as needed.
- Validate end-to-end
- Query to verify
Short_Name__cand new DocuSign IDs:
sfdx force:data:soql:query -u ORG_ALIAS -q "SELECT Id, Name, Short_Name__c, dfsle__DocuSignId__c FROM dfsle__EnvelopeConfiguration__c WHERE Short_Name__c != NULL" --resultformat csv
- Trigger the Flow or call the Invocable Apex (in Developer Console or by running the Flow in UI) to send a test envelope and confirm the imported template is used and merge fields populate as expected.
Rollback
- Keep your original export CSV from step 1 as a rollback file. To revert, re-run Data Loader using the backup CSV to restore prior
dfsle__DocuSignId__cvalues.
Troubleshooting
- If a bulk insert/update fails, check Field-Level Security, API access for the managed-package object, and required fields enforced by the package.
- If the DAL import does not preserve some merge mappings, capture the problem template and contact DocuSign support — but DAL is the recommended method because it preserves Salesforce-related merge fields.
Appendix
- Example SOQL to list templates with non-blank
Short_Name__c:
SELECT Id, Name, Short_Name__c FROM dfsle__EnvelopeConfiguration__c WHERE Short_Name__c != NULL
- Example
updates.csv:
Id,dfsle__DocuSignId__c
00Nxxxxxxxxxxxx,AAAAAAAA-BBBB-CCCC-DDDD-111111111111
- Example
inserts.csv:
Name,Short_Name__c,dfsle__DocuSignId__c
Invoice Template - EN,INV_EN,AAAAAAAA-BBBB-CCCC-DDDD-111111111111
If you want, I can:
- Export the current
dfsle__EnvelopeConfiguration__crecords from an org (provideORG_ALIAS) and prepareupdates.csv/inserts.csvpre-filled with current data. - Add the MDAPI field metadata for
Short_Name__cintodeploy/mdapi/objects/dfsle__EnvelopeConfiguration__c/fields/and updatedeploy/mdapi/package.xmlfor deployment.
Last updated: 2026-04-01