Use Response Data Handling to Store Data Received from a Third-Party System
When a Data Destination A Data Destination specifies where to send data from a submitted form. You can use Data Destinations to automate data sharing and storage, routing data to a specific service (such as email or cloud storage) in several different formats. executes, it creates or updates a record in TrueContext or a third-party system. Response Data Handling enables you to store response outputs, such as record identifiers, after a Data Destination executes. You can reference the output stored in a “parent” destination in subsequent “child” destinations to make sequential requests to a third-party system. This topic describes how Salesforce, ServiceNow, HTTP, and HTTP File Upload Data Destinations A Data Destination specifies where to send data from a submitted form. You can use Data Destinations to automate data sharing and storage, routing data to a specific service (such as email or cloud storage) in several different formats. can store responses for use in subsequent Data Destinations.
Available on the Advanced and Enterprise tiers:
Contents
What is Response Data Handling?
The term Response Data Handling refers to how TrueContext stores Key‑value pairs A key-value pair is a set of two related data elements. The first element identifies the type of data, such as "name". The second element identifies the actual value, such as "Elizabeth". in a Data Destination based on a third-party system response. You can store this response data in Salesforce, ServiceNow, HTTP, and HTTP File Upload Data Destinations.
You can use the stored response output in subsequent Data Destinations to make sequential requests to other systems. For example, you can:
-
Create a Salesforce or ServiceNow record in an initial Data Destination and use the stored ID for that record in a subsequent Data Destination.
-
Create a document with an initial HTTP Data Destination and store a URL based on the third-party system response. A subsequent Email Data Destination can send an email that includes the URL stored by the initial (parent) destination.
-
Upload a Word or PDF document to your document management platform using an HTTP File Upload Data Destination. Store the file ID for use in subsequent Data Destinations.
Note:HTTP File Upload Data Destinations only store response outputs if youonly link one document when you add the destination to the form, and
don’t send attachments as separate files, such as images or annotated documents.
To store response outputs for more than one document, create separate HTTP File Upload Data Destinations. Link a single document to each Data Destination to store the respective response outputs.
How Response Data Handling works
When TrueContext executes a Data Destination, it “calls” a third-party system. The third-party system returns a structured response that the TrueContext server converts into key‑value pairs.
For example, if an HTTP server responds with the following JSON body:
{ "id": 12345, "profile": { "firstName": "John", "lastName": "Smith" }, "contact": { "home": { "email": "jsmith@gmail.com", "phone": "613-225-5555" } } }
then the resulting key-value response output is:
Key | Value |
---|---|
body.id |
12345 |
body.profile.firstName |
John |
body.profile.lastName |
Smith |
body.contact.home.email |
jsmith@gmail.com |
body.contact.home.phone |
123-456-7890 |
Tip:For specifics about the key-value pairs in a third-party system response, refer to that system's documentation.
The following table describes the process of storing and using response outputs.
Stage | Description |
---|---|
1 | Submitted form triggers Data Destination 1. |
2 | Data Destination 1 executes and creates a new record in the third-party system. |
3 | The third-party system responds with key-value pair data, such as the record ID. |
4 |
TrueContext stores the response data on the server as part of the Form Submission. Note:Response data is stored with a specific Form Submission.
|
5 |
Data Destination 2 looks up the values stored by TrueContext Data Destination 1 and uses these values to identify the “parent” record in the third party-system. Tip:This is the “child” Data Destination. |
Note:Only Salesforce, ServiceNow, HTTP, and HTTP File Upload Data Destinations currently store response outputs from third-party systems. Any subsequent Data Destination, however, can use the stored result.
How to reference stored responses
The %o
DREL Data Reference Expression Language (DREL) is used to get form data and metadata and add it to a string, such as dates, usernames, or answers to questions in forms. reference links the initial and subsequent TrueContext Data Destinations, as described in the following example:
%o[Destination Unique ID A Unique ID refers to the specific identifier of a question, form page, form section, or Data Destination. Unique IDs are used as reference points when pulling data for conditional logic, Analytics projects, Data Destinations, and Documents.][key]
where
-
Destination Unique ID
is the unique identifier for the initial Data Destination, and
-
key
identifies a specific value in the stored response.
Info:The topic DREL Complete Reference List provides more detail about DREL syntax.
Examples of Response Data Handling
Create Parent and Child records
The following diagram illustrates how TrueContext uses stored responses to create linked Salesforce records produced by separate Data Destinations. In this example, a Salesforce Case Data Destination gets the stored AccountId
from the Salesforce Account Data Destination. This creates a “child” Case record for a “parent” Account record.
Note:The lookup field between the parent and child records must already exist in Salesforce.
The following example shows the response output from a Salesforce Account Data Destination:
The topic View Destination Response Outputs in the Web Portal describes how to find out what your Data Destination stores.
The topic Configure Response Data Handling for Salesforce Data Destinations describes how to set up a parent-child relationship.
Keep in mind that TrueContext stores the ID of the last Salesforce object created. If a Data Destination creates a record and attaches files to it, TrueContext stores the ID of the last file attached. If you need to create a record and attach files to it, we recommend that you create two separate Data Destinations.
For more information about Salesforce API responses, refer to the Salesforce API documentation.
Use the Response Outputs to send an Email
HTTP Data Destinations return all headers, status information, and any custom-configured response information. In the following example, response outputs stored in an HTTP Data Destination populate fields in a subsequent Email Data Destination:
Note:TrueContext can only parse JSON and XML responses for HTTP destinations.
-
To test what your HTTP destination stores, follow the instructions to View Destination Response Outputs in the Web Portal.
-
The topic Configure Response Data Handling for HTTP Data Destinations describes how to set up a parent HTTP destination.