Generate S-Doc, Preparing, and Sealing Envelope Invocable Apex Actions

In this article, we will walk you through the process of incorporating the power and flexibility of the S-Docs and S-Sign SDK methods directly within a Salesforce Flow via Invocable Apex Actions. By following these step-by-step instructions, you'll empower your end-users to effortlessly generate documents and document signing links, ensuring a smooth and efficient signing event.

Build a Flow Leverages S-Docs and S-Sign Invocable Apex Actions

In your Salesforce Org, navigate to Set-Up > Flows > New

Choose which type of flow you would like to set-up:
Flow selection screen in the Salesforce Flow Builder

Step 1: Add the Generate Document Action

  • Add an Action Element after Start in the Flow
  • Choose: S-Docs
  • Search for Generate Document
  • Add a Base Record Id and Template Id and ensure there are inputs
  • Open Advanced section and ensure Always start a new transaction is checked
  • Click Done
Note: The Base Record Id and Template Id inputs accept both Resource and Static Values

S-Docs Invocable Apex Actions menu in Flow Builder

The Generate Document apex action in Salesforce flow builder.

Step 2: Add the Prepare Envelope Action

  • Add an Action Element after Start in the Flow
  • Choose: S-Docs
  • Search for Prepare Envelope
  • Add the SDoc IDs to reference the value from the previous step: {!Generate_Document.sdocId}
  • Open Advanced section and ensure Always start a new transaction is checked
  • Click Done

The Prepare Envelope apex action in Salesforce flow builder.

Step 3: Add the Seal Envelope Action

  • Add an Action Element after Start in the Flow
  • Choose: S-Docs
  • Search for Seal Envelope
  • Add the Envelope ID to reference the value from the previous step: {!Prepare_Envelope.envelopeId}
  • Open Advanced section and ensure Always start a new transaction is checked
  • Click Done

The Seal Envelope apex action in Salesforce flow builder.

The output from the Seal Envelope action, {!Seal_Envelope.signingLink},  is now available to call other elements of the flow. For example, this variable can be leveraged to surface the URL for which an end-user would need to navigate to for a sign in-person event. A preferred method to accomplish this is via a Screen element with display text component.

At this point, the flow is completed and can be leveraged in a variety of ways to make it accessible to the end-user.


Required Licensing, Permissions, and Sharing Settings for Experience Cloud Users

Digital Site User Requirements:
  • S-Docs and S-Sign license assignments
  • S-Docs managed package permission sets: SDocs User, SSign Experience
Cloud User Requirements:
  • Sharing settings for SDocs Template must be set to Public for Default External Access
  • Navigate to Set-Up > Sharing Settings > Edit > Find SDoc Template and change Default External Access dropdown to Public Read/Write.

Tags: , , ,

Was this helpful?