Skip to main content

Build Simple Integration Procedures

Learning Objectives

After completing this unit, you’ll be able to:

  • Describe where Integration Procedures fit within the data flow.
  • Build a simple Integration Procedure to get data for an OmniScript.
  • Build a simple Integration Procedure to save updated data to Salesforce.

Where Integration Procedures Fit Within the Data Flow

In the previous unit, you designed a few Integration Procedures based on scenarios. In this unit, you will build an Integration Procedure that passes data from the Account object to an Edit Account OmniScript. Then, you will build another Integration Procedure that saves this data that was added or changed in the OmniScript back to the Account object.

First, let’s see where an Integration Procedure fits in the data flow for this scenario. 

  • When the Edit Account OmniScript launches from an action on a FlexCard, it passes the RecordId for the account (called the AccountId) from a JSON node to a Data Mapper Extract.
  • The Edit Account OmniScript saves this RecordId in a variable called ContextId. AccountId is an arbitrary name for the RecordId, which means you can call the RecordId anything you like; however, the name must be the same in each of the elements for the data to flow properly between them and Salesforce. It’s best practice to label the ContextId with a description of what kind of ID it is.
  • The OmniScript passes a variable called AccountId to an Integration Procedure, which passes the AccountId to a Data Mapper Extract.
  • The Data Mapper Extract uses the AccountId in Salesforce Object Query Language (SOQL) to retrieve data from Salesforce. This includes not only the AccountId but also data from the Account record. The Data Mapper Extract sends the data, in JavaScript Object Notation (JSON) format, back to the Integration Procedure and then to the OmniScript.

Data flow from an OmniScript to a data tool that extracts data from Salesforce.

  • The user and other OmniScript actions manipulate the data.
  • An updated data JSON, including the AccountId, is then passed to an Integration Procedure, which passes it to a Data Mapper Load.
  • The Data Mapper Load uses the AccountId to identify the original account record and updates the data in Salesforce.

Data flow from an OmniScript to a data tool that saves data from Salesforce.

Build an Integration Procedure to Get Data

In scenario 1 in the previous unit, you designed the Integration Procedure to get data for the Edit Account OmniScript. You chose the Data Mapper Turbo Extract Action to call a Data Mapper Turbo Extract to get Account data from Salesforce. Then you chose the Response Action to send that data back to the Edit Account OmniScript from the Integration Procedure. That process looks like this. 

Action elements involved in the Data Extract process.

How do you configure all this in the Integration Procedure itself? 

A Data Mapper Turbo Action displays in the Structure panel.

  1. Drag a Data Mapper Turbo Action (1) from the Available Components panel to the Structure panel.
  2. Give it a name that describes its purpose, such as DRGetAccountDetails.The Data Mapper Turbo Extract Action’s Properties show the Name of the Data Mapper and AccountId as the Input Parameters.
  3. In the Data Mapper Turbo Action’s Properties panel, select the Data Mapper Turbo Extract you want to use in the Data Mapper Interface (1) field.
  4. Under Input Parameters (2), enter AccountId for both the Data Source and Filter Value. Remember, AccountId is an arbitrary name for the RecordId, but it must be the same in each of the elements for the data to flow properly between them and Salesforce.The Response Action’s Send JSON Path field.
  5. Configure the Response Action (1) to tell the Integration Procedure what data to send back to the Edit Account OmniScript. To trim the data and return only what the OmniScript needs, enter DRGetAccountDetails in the Send JSON Path (2) field.

Way to go! You’ve configured the Integration Procedure, but now you want to test if it’s working. You need the RecordId of an account to do this, so let’s take a moment to explain what this is and how you find it.

All records in Salesforce have a unique RecordId. To find a RecordId for an account, simply open any Account record in your org and copy the RecordId from the URL. 

The Account RecordId displays in the URL.

Now that you have an AccountId, you’re ready to test. 

The Integration Procedure returns results in the Response pane.

On the Integration Procedure’s Preview tab, enter a Key/Value pair in the Input Parameters panel (1) such as AccountId for the Key and an Account’s RecordId for the Value.

Click Execute (2) to run the Integration Procedure. The Response pane (3) returns results to confirm it is extracting data correctly.

The Debug Log shows data to confirm the Integration Procedure and Data Mapper are connected.

The Preview tab includes a Debug Log (1), which helps you to work through and identify any issues with the output and the input for each element in the Integration Procedure. To ensure the Data Mapper is connected to the Integration Procedure, select DRGetAccountDetails (2) and confirm that the Account information displays.

In the Debug Log dropdown, Original Input is what you expect to pass to the Integration Procedure. The Debug Log includes two entries for each element. NAME displays the output and NAMEDebug shows the input for the step. If you don't see expected outputs, review the debug entry to find out what is wrong with the input data.

Everything seems correct and in order, so you’re ready to activate this version of the Integration Procedure.

The Procedure Configuration element includes the Activate Version button.

In the Procedure Configuration (1) element properties, click Activate Version (2). 

Do a final test to confirm the Integration Procedure is working in the Edit Account OmniScript, and that the Integration Procedure is available for use in the OmniScript only if it’s active. 

The Edit Account OmniScript includes Integration Procedure Actions that you can configure to link Integration Procedures to the OmniScript. 

An Integration Procedure is selected in the Integration Procedure field.

The IPGetAccountDetails Integration Procedure Action (1) shows team_getAccountDetails selected in the Integration Procedure field (2).

From the Edit Account OmniScript’s Preview tab, enter your RecordId into the Context ID field. The Preview displays data retrieved by the Integration Procedure.

The Edit Account OmniScript displays data retrieved by the Integration Procedure.

Congratulations! You’ve learned how to create an Integration Procedure that gets data for an OmniScript. 

The data displayed for the Website is www.acme4.com. But what if you want to change that to www.acme.com? Let’s turn our attention to an Integration Procedure that saves data from an OmniScript.

Build an Integration Procedure to Save Data

When you designed the Integration Procedure for this scenario, you chose the Data Mapper Post Action element to save updated data from the Edit Account OmniScript to Salesforce. Here’s the flow. 

Action elements involved in the Data Load process.

Let’s configure it. 

A Data Mapper Post Action displays in the Structure panel.

  1. Drag a Data Mapper Post Action (1) from the Available Components panel to the Structure panel.
  2. Give it a name that describes its purpose, such as DRSaveAccountDetails (2).

In the Data Mapper Post Action’s Properties panel, select the Data Mapper Load you want to use in the Data Mapper Interface field.The Data Mapper Post Action’s Properties show the Name of the Data Mapper.

Now, you need to activate this Integration Procedure to make it available for use in the Edit Account OmniScript. 

Test if the Integration Procedure is working in the Edit Account OmniScript. 

An Integration Procedure is selected in the Integration Procedure field.

  1. In the Edit Account OmniScript, link the IPSaveAccountDetails Integration Procedure Action (1) to an Integration Procedure, in this case, the team_saveAccountDetails (2).
  2. From the Edit Account OmniScript’s Preview tab, enter your RecordId into the Context ID field. The Preview displays data retrieved by the first Integration Procedure you built.The website URL is changed.
  3. To test if the second Integration Procedure works, make a change to the data. Let’s change the www.acme4.com website to www.acme.com (1) and click Next (2).
  4. Open the Account record to confirm the data was updated successfully.

The Account record shows the updated data.

We hope you’re feeling pretty confident about your Integration Procedure skills now. Remember, if you need to get, save, and manipulate data behind the scenes, Integration Procedures are your go-to tools. 

Teilen Sie Ihr Trailhead-Feedback über die Salesforce-Hilfe.

Wir würden uns sehr freuen, von Ihren Erfahrungen mit Trailhead zu hören: Sie können jetzt jederzeit über die Salesforce-Hilfe auf das neue Feedback-Formular zugreifen.

Weitere Infos Weiter zu "Feedback teilen"