Use Response Data Handling to Store Data Received from a Third-Party System

When a Data DestinationClosed 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 DestinationsClosed 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:

Essentials
Advanced
Enterprise

Contents

What is Response Data Handling?

The term Response Data Handling refers to how TrueContext stores Key‑value pairsClosed 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 you

    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.
  • If you submit another form, the new response data does not overwrite data from previous Form Submissions.
  • Re-executing a Data Destination for a specific Form Submission can result in different response data. Previous response data is overwritten for that 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 DRELClosed 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 IDClosed 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.

Diagram that shows the initial, parent Salesforce Account destination sending data and receiving response output. Then, the child (subsequent) Salesforce Case destination executes and references the key-value pairs stored by the parent destination. The Case destination updates the child record of the parent Account record.

The following example shows the response output from a Salesforce Account Data Destination:

Destination Outputs section that shows the Salesforce key-value pairs id, success, and errors.

Info: 

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:

Diagram that shows the initial, parent HTTP PUT/POST destination sending data and receiving response output. Then, the child (subsequent) Email destination executes and references the key-value pairs stored by the parent destination. The email destination populates the "Customer" field with values from the parent stored response.

Note:TrueContext can only parse JSON and XML responses for HTTP destinations.

Info: