You are here:
Create a Contact and Use a Formula
A common task for an Omnistudio Data Mapper Load is to create a record in a Salesforce object. Depending on the source data, the input might need light cleanup or a check for a particular field status. In this example, the Data Mapper load creates a record in the Contact object and sets the Authorized field to true if the contact is over 18 years old.
The input JSON for this example includes the contact details, and the data is in expected formats. But the names aren't the same as the Contact fields. In this scenario, a custom checkbox field named Authorized is added to the Contact object as Authorized__c and to the Contact layout.
{
"ContactDetails": {
"Birthdate": "10/10/1954",
"LastName": "Singh",
"Telephone": "5106345789",
"FirstName": "Sanjay"
}
}Create Settings
| Field | value | notes |
|---|---|---|
| Interface Type | Load | |
| Input Type | JSON | In this example, the input is provided as JSON and not pulled from another source. |
| Output Type | sObject |
Object Settings
Click + and select Contact.
Mapping Settings
Map data from the input JSON to the target Salesforce object and field. If you’re using the designer on a managed package, click Fields. See Configure an Omnistudio Data Mapper Load.
Input JSON Path |
Domain Object Field |
|---|---|
ContactDetails:Authorized |
Authorized__c |
ContactDetails:Birthdate |
Birthdate |
ContactDetails:FirstName |
FirstName |
ContactDetails:LastName |
LastName |
ContactDetails:Telephone |
Phone |
Formula Settings
Click Formula, and define a formula for the Data Mapper Load. See Use Formulas in Omnistudio Data Mappers.
- Formula:
IF(AGE(ContactDetails:Birthdate) > 18, "true", "false") - Formula Result Path:
ContactDetails:Authorized
Load Preview
In Preview, enter the sample JSON as input.
{
"ContactDetails": {
"Birthdate": "10/10/1954",
"LastName": "MyLastName",
"Telephone": "5106345789",
"FirstName": "MyFirstName"
}
}After you execute the sample Data Mapper in Preview, a link to the object is displayed in the Objects Created pane. Click the link and verify that the Authorized checkbox is checked only if the contact is over 18 years old. (The field might be visible only in edit mode.)

