You are here:
Use the DocuSign Signature Action to Sign Documents From Within an Omniscript
Users can sign a document from an Omniscript and download the signed document for their records. After you prepare the DocuSign template and map the fields from the Omniscript to the template using an Omnistudio Data Mapper Transform, you can create a DocuSign Signature Action in the Omniscript. When the action runs, a DocuSign window opens containing the prefilled document. The user must sign or decline to sign the document before continuing the Omniscript.
Before you begin:
-
From the Omniscript elements panel, drag a DocuSign
Signature action element to a Step or block element, where it renders
as a button.
Note
Edit Block doesn't support the DocuSign Signature action.
- In the DocuSign Signature Action properties, click Add Template. The Edit Template window opens.
- Select your DocuSign Template.
-
Select a template role.
Roles are defined in the DocuSign template.
-
Enter the name of the Data Mapper Transform.
If the Data Mapper doesn't exist, create a Data Mapper Transform.
- Click Save.
-
Enter a Signer Name and Signer
Email.
The Signer Name and Signer Email fields support merge fields. For example
%FirstName% %LastName%merges the contents of the FirstName and LastName fields into the Signer Name field during runtime. - Add an Email Subject that recipients receive after signing.
- If needed, enter a DocuSign Return Url that replaces the DocuSign window after signing is complete.
- If needed, enter display formats for date and time values.
To use an Omniscript with a DocuSign Signature Action in an Experience Cloud site, add the OmniScriptLwcDocuSignViewPdf Visualforce page permission to any profiles using the Omniscript.
When the DocuSign window opens, a node is written to the Omniscript data JSON. Preview the Omniscript to see the response node in the data JSON:
"DocuSignElementName": [
{
"status": "Declined",
"envelopeId": "xyz123"
},
{
"status": "Completed",
"envelopeId": "xyz123"
}
]A new status and envelopeId are generated every time the DocuSign window launches. Statuses
include Completed, Declined, and In Process.
If you’re a developer overriding the OmniScriptDocuSignReturnPage in your Omniscript, post the DocuSign Return Page status back to the Omniscript using window.parent.postMessage. For example:
window.addEventListener('DOMContentLoaded', function(event){
var domClass = '';
var searchStr = event.currentTarget.location.search;
searchStr = searchStr.substring(searchStr.indexOf('&event='), searchStr.length);
searchStr = searchStr.substring(searchStr.indexOf('=') + 1,searchStr.length);
if(searchStr === 'signing_complete') {
domClass = document.getElementById('signing_complete');
domClass.style.display = 'block';
} else {
domClass = document.getElementById('signing_failed');
domClass.style.display = 'block';
}
_window.parent.postMessage(searchStr, '');_*
});
