Skip to main content

Build an Integration Procedure to Retrieve Updated Data

Create an Integration Procedure to Get External Country Details

In the previous units, you created an Integration Procedure to fetch and process order data and country data from an external site. You configured the same Integration Procedure to update the order data as well.

Now you build a second Integration Procedure named Fetch External Country Details to get the updated country data. In the next badge, you build an Omniscript and feed the data to it.

Let’s create the Integration Procedure.

  1. Click App Launcher, then find and select Integration Procedures.
  2. Click New.
  3. On the New Integration Procedure window, enter these details.
    • Integration Procedure Name: Fetch External Country Details
    • Type: Order
    • Sub Type: GetCountryDetails
  4. Click Save.

The Integration Procedure opens in the Integration Procedure Designer in a new tab. Do you recall how you configured the fetch workflow in the Integration Procedure in unit 1? You do the same for this one.

Add Data Mapper Extract Action

Add an extract action element to fetch the updated shipping country name.

  1. In the Integration Procedure designer, click Add component, then find and select Data Mapper Extract. A data mapper extract action element is added to the canvas.
  2. Enter these details in the DataMapperExtract panel.
    • Element Name: DMGetNewShippingCountry
    • Data Mapper Name: DMExtractShippingCountry
  3. Click Close Panel to close the panel.
  4. Save your work.

With the Data Mapper Extract Action in place, let's move on to the next element.

Add HTTP Action

You add an HTTP action element to fetch the country details from the external website using the updated country name.

  1. In the Integration Procedure designer, click Add component after the Data Mapper Extract Action, then find and select HTTP. An HTTP Action element is added to the canvas.
  2. Enter these details in the HTTP Action panel.
    • Element Name: HTTPGetUpdatedExternalCountryDetails
    • Request URL: https://th-hoc-earthnations-e1403d711d73.herokuapp.com/name/%DMGetNewShippingCountry:OrderShippingCountry%
      OrderShippingCountry is the ShippingCountryNoSpace custom field data coming from the DMGetNewShippingCountry data mapper action.
    • HTTP Method: GET
  3. Click Close Panel to close the panel.
  4. Save your work.

Now that you’ve the data from the external website, let’s transform it.

Add Data Mapper Transform Action

Add and configure a data mapper transform action element to restructure and format the country data.

  1. In the Integration Procedure designer, click Add component after the HTTP Action element, then find and select Data Mapper Transform.
  2. Enter these details in the DataMapperTransform panel.
    • Element Name: DMTProcessUpdatedCountryDetails
    • Data Mapper Name: DMTransformUpdatedCountryData
  3. Under the ‘Additional Input, Additional Output, and Failure Response’ section, for Additional Input, click + Add Key Value Pair.
  4. Enter these details.
    • Key: Input
    • Value: %HTTPGetUpdatedExternalCountryDetails%
  5. Click Close Panel to close the panel.
  6. Save your work.

We’re almost done—just one more action.

Add Response Action

Finally, you add and configure a response action element that provides the updated country data to an Omniscript.

  1. In the Integration Procedure designer, click Add component after the Data Mapper Transform Action element, then find and select Response.
  2. In the Response panel, for Element Name, enter ResponseCountryData.
  3. Under the Send and Response Transformations section, for Send JSON Path, enter DMTProcessUpdatedCountryDetails.
  4. Under the Additional Output Response section, for Additional Output, click + Add Key Value Pair and enter these details.
    • Key: message
    • Value: Shipping address successfully updated
  5. Click Close Panel to close the panel.
  6. Save your work.
  7. Click Activate.

After you activate the Integration Procedure, it’s available for you to use in any Flexcard or Omniscript.

This is how the Fetch External Country Details Integration Procedure structure appears after you complete the configuration.

The elements created in the instructions in the Integration Procedure Designer.

Are you wondering why you’re creating a separate Integration Procedure just to fetch the external country details? Why can’t you do all the processes in a single Integration Procedure? There’s a reason: Salesforce includes a guardrail where you can’t perform an update record action and make an external call in the same transaction. If you do that, you’ll get an error.

Wrap Up

In this badge, you learned how to build and configure Integration Procedures to fetch and update data. You created the Process Customer Integration procedure to fetch and transform order and external country data. You also configured it to update the shipping details of an order. And you created the Fetch External Country Details Integration Procedure to fetch and transform the new country details from the external source.

Next, complete the Order Data Modification with Omnistudio Omniscripts badge: Learn how to create an Omniscript to update the order shipping details.

Condividi il tuo feedback su Trailhead dalla Guida di Salesforce.

Conoscere la tua esperienza su Trailhead è importante per noi. Ora puoi accedere al modulo per l'invio di feedback in qualsiasi momento dal sito della Guida di Salesforce.

Scopri di più Continua a condividere il tuo feedback