Build Data Mapper Extract to Fetch Order Data
Get Started with Data Mappers
Now that you understand the example scenario and customer requirements, it’s time to start building the Omnistudio components. As we mentioned in the previous unit, we start with data mappers in this badge to configure the data integration. Data mappers fetch, load, and transform Salesforce data. You use these data mappers to fetch and update order details, and also fetch external country information.
Here are the data mappers that you’ll build in this badge.
Data Mapper Name |
Interface Type |
Purpose |
|---|---|---|
DMExtractOrderDetails |
Extract |
Fetch the order information from the Order object. |
DMTransformOrderAndCountryData |
Transform |
Restructure and map the country data to a format that can be consumed by other components. |
DMLUpdateOrderDetails |
Load |
Load the new shipping address to the Order object. |
And here are the additional data mappers provided in the Developer Edition org.
Data Mapper Name |
Interface Type |
Purpose |
|---|---|---|
DMExtractShippingCountry |
Extract |
Extract the shipping country name from the Order object after the shipping address is updated. |
DMTransformUpdatedCountryData |
Transform |
Restructure and map the country data to a format that can be consumed by other components. |
You use these data mappers in the next badge, where you create and configure the Integration Procedures.
Create a Data Mapper Extract
First, create a data mapper extract to get the order details.
- Click
, then find and select Data Mappers.
- Click New.
- In the Create New: Data Mapper window, enter these details.
- Name:
DMExtractOrderDetails
- Interface Type: Extract
- Input Type: JSON
- Output Type: JSON
- Name:
- Click Save. The data mapper opens in the Data Mapper Designer in a new tab.
- In the Extract tab, click
. An Extract Object element appears in the designer canvas.
- For Extraction Object, find and select Order.
- For Extract Object Path, enter
Order.
- In the Filter section, enter these details.
- Field:
Id
- Operator: Equals
- Value:
OrderId
- Field:
Data Mappers auto save your work after every change.
Map Input and Output Paths in the Data Mapper Extract
In the previous section, you created a Data Mapper Extract. Next, map the data from the source object to a destination path using the Extract JSON Path and JSON Output Path fields.
If you’ve closed your Data Mapper Extract, click
, then find and select Data Mappers. In the Data Mappers list view, click DMExtractOrderDetails to open the data mapper in the Data Mapper Designer.
- In the Data Mapper Designer, click the Mapping tab.
- Click Create Mapping.
- On the Create Mapping window, for Extract JSON Path, find and select Order:OrderNumber.
Notice the Order prefix is added to all the Order object fields. This is because you entered Order as the Extract Object Path earlier. You can give any name for the Extract Object Path.
- On the Create Mapping window, for JSON Output Path, enter
OrderOutput1.
- Click Save & New to add more mappings.
- Repeat steps 3 to 5 and add these mapping data. After you enter the last mapping details, click Add on the Create Mapping window.
Extract JSON Path |
JSON Output Path |
|---|---|
Order:Status |
OrderOutput2 |
Order:Shipping_Method__c |
OrderOutput3 |
Order:ShippingStreet |
OrderOutput4 |
Order:ShippingCity |
OrderOutput5 |
Order:ShippingState |
OrderOutput6 |
Order:ShippingPostalCode |
OrderOutput7 |
Order:ShippingCountry |
OrderOutput8 |
Order:Account.Name |
OrderOutput9 |
Order:TotalAmount |
OrderOutput10 |
Order:ShippingCountryNoSpace__c |
OrderOutput11 |
In the Order:Account.Name Extract JSON Path, Account.Name is a lookup field. You're fetching the Account Name from the Account object related to the Order. You won’t find it in the Extract JSON Path dropdown list.
These mappings include two custom fields provided in your org that serve a specific purpose related to the requirement.
-
ShippingCountryNoSpace is a custom field in the Order object that stores the country name without spaces. The URL you use in the Integration Procedure HTTP action can’t include any space. So if there’s a space in the country name, such as the United States, the field uses a formula to add %20 in place of the space. This makes sure the URL is in the correct format.
-
Shipping Method is a custom field in the Order object that captures the shipping method a customer chooses for their delivery timeline requirement. The shipping method field includes these options: Standard, Expedited, and Overnight.
After you create a data mapper, it’s activated by default and is available for you to use. So your DMExtractOrderDetails data mapper is ready.
Test Your Data Mapper
But how do you know whether you’ve configured the data mapper correctly and if it’s fetching the data? Here’s how you can test your data mapper (we won’t check this).
- In the Data Mapper Designer, click Preview.
- In the Input Parameters section, click Edit as Params.
- Click + Add Key/Value.
- For Key, enter
OrderId.
- For Value, enter the record Id of the Order with Order Number 00000101. To get the record Id, perform these steps.
- Switch to the tab where the Omnistudio app is open or open it in a new tab.
- Click
, then find and select Orders.
- In the Orders list view page, click
beside Recently Viewed and select All Orders.
- Click 00000101.
- Copy the record Id from the URL. For example, 801ak00001RLKGiAAP is the record Id in this sample URL. The record Id in your Developer Edition org will be different.
- Switch to the tab where the Omnistudio app is open or open it in a new tab.

6. Click Execute.

In the Response pane, you can see the data mapper has fetched the correct data for each field from the specified order.
What's Next
In this unit, you learned how to create a data mapper extract and configure the input and output mappings. In the next unit, you learn how to create data mapper transform and data mapper load.
