Hello, it’s Atlas Can here. Today, we’re diving deep into automating an integration between Salesforce and DocuSign, utilizing webhooks for streamlined envelope status tracking. We’ll assume you already have Salesforce and DocuSign accounts and have installed Declarative Webhooks from the Salesforce AppExchange.
Docusign Connect offers powerful capabilities for integrating webhooks into your integration projects. Webhooks, as HTTP callbacks, play a crucial role in enabling real-time communication between various applications. By automatically transmitting messages or data when specific events occur in the originating system, webhooks provide an efficient means for applications to stay updated and respond promptly to changes, eliminating the need for constant polling or manual data synchronization.
In the context of Docusign Connect, these webhooks serve as a vital link in establishing seamless, automated workflows that enhance user experiences and optimize business operations. By leveraging Docusign Connect’s webhook functionality, you can effortlessly send event data from DocuSign to other systems like Salesforce. The below integration example allows you to utilize the power of Declarative Webhooks in Salesforce to interpret and process the received data, facilitating the automatic updating of envelope statuses.
With Docusign Connect’s webhook capabilities, you can unlock a world of possibilities for efficient data exchange and workflow automation. By harnessing the real-time communication enabled by webhooks, you can create dynamic, responsive systems that enhance collaboration, streamline processes, and deliver exceptional user experiences.
Let’s consider a practical scenario – running a real estate agency. In this industry, Salesforce often serves as a comprehensive CRM solution, while DocuSign plays a pivotal role in obtaining electronic signatures. A typical property sale entails multiple documents requiring signatures from various parties, making envelope status tracking (i.e., when they’re sent, viewed, and signed) a crucial aspect of the process.
Integrating Salesforce and DocuSign through webhooks automates envelope status updates in Salesforce whenever there’s a change in DocuSign. This real-time synchronization keeps the sales team abreast of the process, ensuring no vital steps are overlooked, thereby enhancing efficiency.
Real-Time Updates: With DocuSign eSignature Connect webhooks, sales teams can receive real-time updates about the status of contracts. This means that as soon as a client opens, views, signs, or declines a contract, the sales team can be immediately notified. This allows for instant follow-up and action.
Efficiency: The automation of updates to contract statuses reduces manual entry work, minimizes the chances of error, and speeds up the sales cycle. Salespeople no longer need to chase down signatures or manually check if a document has been signed.
Enhanced Customer Interaction: With real-time data, sales representatives can timely reach out to clients who might have viewed but not signed a contract, addressing any potential issues or concerns right away. This proactive customer engagement can lead to improved customer satisfaction and higher closure rates.
Visibility and Traceability: The team can have a clear overview of which contracts are still pending and which are completed. This increased transparency can help in forecasting, as well as tracking the performance of individual sales reps.
Automated Workflows: Depending on the nature of the update from the webhook, additional automated processes can be triggered in the CRM. For instance, once a contract is signed, it could automatically trigger a product delivery process or initiate an onboarding process.
Risk Reduction: With DocuSign’s audit trails and the CRM’s record keeping, the sales team will have a complete and accurate record of all contract activities. This can be especially important for compliance and dispute resolution.
Time Management: By automating administrative tasks, sales representatives can spend more time building relationships with clients and focusing on selling, thus increasing their productivity and effectiveness.
The combination of DocuSign and Salesforce can provide an array of advantages that enhance efficiency, accuracy, and user experience, creating an environment that fosters business growth and customer satisfaction.
One of the primary benefits of this integration is the streamlining of business processes. With the ability to work within the Salesforce platform, sales contracts can be prepared, sent out for signature, and returned without the need for switching between different applications. This cohesiveness eliminates unnecessary steps and creates a smoother workflow, making the entire process much more efficient and user-friendly.
Alongside improved efficiency, accuracy is another crucial benefit. Traditional methods often involve manual data entry, which is susceptible to human error. However, with DocuSign and Salesforce integration, data can be auto-populated from Salesforce records into DocuSign envelopes. This seamless transition of data not only reduces the likelihood of errors but also ensures consistency across all documents, fostering a more reliable and accurate system.
This integration also plays a vital role in accelerating sales cycles. The moment a deal is closed in Salesforce, contracts or other relevant documents can be immediately dispatched for signature via DocuSign. By removing delays often associated with manual procedures, businesses can execute deals faster, which in turn can lead to increased sales volume and revenue.
Real-time visibility is another significant advantage. With DocuSign’s status updates available directly within Salesforce, businesses can easily monitor the progress of document signing. This feature provides teams with immediate insights into the status of agreements, helping them plan their next steps and follow-ups more effectively.
In terms of compliance, DocuSign’s digital signatures provide a secure and legally binding method for signing documents. This robust security feature, coupled with Salesforce’s comprehensive customer relationship management (CRM) capabilities, ensures that businesses can maintain compliance with various regulations, providing peace of mind and reinforcing trust with their customers.
Moreover, the combination of DocuSign and Salesforce contributes to an improved customer experience. By offering a faster, smoother signing process, businesses can meet and exceed customer expectations, leading to higher customer satisfaction and loyalty.
The digitization and automation of the document signing process can also lead to significant cost savings. By reducing the need for physical paperwork and manual procedures, businesses can save considerable time and resources. These savings can then be reinvested into other areas of the business, promoting growth and innovation.
Finally, the integration of DocuSign and Salesforce enhances document security. DocuSign’s robust security features ensure the integrity and authenticity of signed documents. When these features are integrated with Salesforce, businesses can leverage these advantages, providing an additional layer of security to their document-handling processes.
While these benefits offer a compelling argument for the integration of DocuSign and Salesforce, it’s important to note that the actual advantages can vary based on specific business processes and how these platforms are utilized. As such, for the most accurate and personalized advice, it’s recommended to consult with a technology partner who specializes in these platforms or to reach out to DocuSign or Salesforce directly.
To set up the integration, start by logging into your DocuSign account. DocuSign supports multiple account types, but we are going to use a developer account for this and our future posts about DocuSign which you can create an account here.
Optionally, you can skip installing the DocuSign eSignature app for Salesforce. There can be plenty of reasons for this, I’ve found the native integration works but you’re limit-constrained with API usage on both DocuSign and Salesforce. Also, Docusign for Salesforce requires additionally licensing costs while Docusign Connect is included in a Business Pro plan which costs only $40/mo.
Maybe you have too many packages installed inside your org already and are hitting limits or having issues with the native app. Maybe you want a more lightweight solution without installing the package and want more fine grained control with your integration. Our example combined with Declarative Webhooks, offers more alternatives for webhook events and processing them.
To keep things detailed and useful, we will talk about creating an envelope template and creating a document with merge fields so you can start using it right away.
Above is how it should look when you connect your DocuSign account to your Salesforce org. If you’re having issues connecting your account like I did for an hour or two, try this:
System.debug(dfsle.AuthService.getLoginUrl(‘/lightning/page/home’));
After this, we need to do additional configuration to be able to send an envelope to our recipient.
Creating an envelope template: Head over to the setup section of the DocuSign App Launcher and go to the envelope templates tab.
I’ve found a generic sales contract document, which we will use to merge fields on a Salesforce object (Opportunity for our use case) with a signature spot and send this with a button.
Upload your file and continue to the next step. Following along, I’ve mapped the contract to be sent to the owner field of the Opportunity record, but obviously, you can use another lookup field for users. As of writing this only lookup fields to users are supported and we cannot map it to an email field.
For the merge field, we are mapping the Opportunity’s amount field in the document. In the next step, we are going to place it in the document so that it is automatically mapped to the final document.
We’re also putting the opportunity name which will be sent by DocuSign when the PDF is generated, it will automatically map this field on the document.
In the final step, add a custom button to the Opportunity object layouts. This is how the sales team will send contracts to the recipients in our demo.
Head over to your developer account, in the main page click on Connect tab. Here, click Add Configuration to where the payload will be received.
Let’s see the payload first, I’m using beeceptor to create an endpoint easily so I can see the incoming payload which we will use to map it to our opportunity record which started the callout.
For the URL, input the endpoint provided by Declarative Webhooks in Salesforce, which we’ll discuss shortly. Then, select the specific events that should trigger the webhook. In our real estate scenario, we’re primarily interested in “Sent”, “Delivered”, “Completed”, and “Declined” statuses.
It’s important we check this checkbox below to include data. We are going to be sent the Opportunity Id for our use case, but for example, you can also get the PDF data as bytecode and process it via Apex.
If you want to see the payload yourself first so you can decide the mapping, put the URL created from here to the configuration setting and configure the trigger events as envelope sent or envelope delivered.
Here’s an example payload in which we are going to map the Opportunity Id and find our record that started the callout.
Then, head over and create an envelope in Salesforce and send it to the recipient according to our envelope template, you should receive the payload after a few seconds.
Having configured the DocuSign webhook, we can now turn our attention to Salesforce. Our objective here is to create an Inbound Callout Template using Declarative Webhooks, which will take the payload incoming from DocuSign and process it accordingly. We will also need to update the URL of the webhook to be published to this newly created Inbound Callout Template.
Here, we’re going to import the JSON that was sent from DocuSign earlier in our inbound template mapping. Here’s how it should look like if you enabled the checkbox for sending data earlier.
In the final step, we’re going to map the data.envelopeSummary.status to our custom field on the Opportunity record. By enabling sending data in our webhook, we can retrieve the Opportunity Id that has started this callout alongside other PDF data.
Now we have our inbound template for Declarative Webhooks set up, we defined an envelope template, button layout, and a custom field to map the envelope response to, we also mapped fields for the DocuSign envelope to be sent.
Now after you get the link from the newly created Declarative Webhooks inbound template, copy the link and update the URL to publish section in Docusign as this address. Here’s how it should look like.
And we are done! Now go ahead and create an envelope with the button placed that is connected to a DocuSign Envelope Template we created earlier, follow through the steps and send the document, at each step of the envelope you will see that it gets updated according to its status inside Salesforce record.
When integrating DocuSign and Salesforce using webhooks, it’s essential to adhere to a set of best practices to guarantee a secure, reliable, and scalable integration.
The benefits of this integration are manifold. It allows the sales team to receive real-time updates in Salesforce whenever there’s a change in envelope status on DocuSign. This not only improves efficiency but also reduces the manual effort required to track document statuses, leaving more time to focus on providing a superior customer experience.
I hope this deep dive into Salesforce and DocuSign integration using Declarative Webhooks has been enlightening. We’ll be delving into more complex functionalities of this integration in future posts, including creating custom actions based on envelope status and more. As always, thank you for reading, and I look forward to sharing more insights in the next post!
Thank you for following this quick guide.
If you want to learn more about Declarative Webhooks, please follow the links below:
More Integration Guides
© Omnitoria, All Rights Reserved.