Skip to main content

Get workflow document data (JSON format)

Y
Written by Yuliia Biletska
Updated over 2 months ago

Using this Apex class in Salesforce Flow Builder, administrators can access and convert data from airSlate workflows into JSON format in Salesforce. This allows for easier and more organized document data processing.

Tip: Before starting, ensure a smooth process by following these steps:

1. Create a text field in the Salesforce object (for example, Account) to store the Document ID.

2. In the airSlate workflow, use the Invoke Salesforce process bot to populate the Document ID field in Salesforce.

Now, letโ€™s proceed to configuring the Salesforce Flow.

1. In Salesforce Setup, navigate to Flows, then New Flow, and choose Screen Flow.

2. Click the plus icon, choose Action, and search for the needed Apex action.

Enter a label and API name (auto-generated) for the Action. Then, provide the ID of the document from which the data will be pulled.

Optionally, you can also define a specific revision of the source document. To specify a document revision, enable the toggle switch and enter the relevant revision ID.

3. Configure the modal window to display the parsed data by adding a Screen element. Enter the label and API name (auto-generated).

Locate the Display Text component in the left sidebar, then drag and drop it onto the canvas. Then, search for the following variables in the element properties panel by starting to enter get:

Variable

Description

{!Get_workflow_document_data.json}

This variable retrieves JSON data from the selected document.

Variable

Description

{!Get_workflow_document_data.error}

This variable displays error messages. Use red text to highlight these messages for better visibility.

Save your settings by selecting Done. Then, save and activate the Salesforce Flow.

4. Create a custom action to generate a button for accessing document data. Navigate to Object Manager, then select Object (Account). Go to Buttons, Links, and Actions, then click New Action.

Choose Flow as the action type, and select the Salesforce Flow you created. Add the label and API name (auto-generated) for the custom action.

Next, go to Account โ†’ Page Layouts โ†’ Account Layout โ†’ Mobile and Lightning Actions. Drag and drop the custom button with the access to document data onto the Salesforce Mobile and Lightning Experience Actions canvas.

6. In Salesforce, go to Admin Tools, then Custom buttons. Create a button connected to the airSlate workflow with the Invoke Salesforce Process bot.

Process overview:

1. Administrators should initiate the workflow to transfer and store the Document ID in the Document ID field of the Account record.

2. Users can click the custom action button to generate a JSON of document fields, which retrieves data into Salesforce.


The generated JSON-format text will appear as follows:

In case of any errors, Salesforce administrators will receive immediate email notifications.

Did this answer your question?