You are here:
Use Formulas in Omnistudio Data Mappers (Managed Package)
For the managed package runtime, to add data to the output of a Data Mapper, define formulas. Several types of Data Mappers (Extract, Transform, and Load) support formulas. When you define a formula, you map its output to the output JSON (for extracts and transforms) or Salesforce object field (for loads).
This information is for Omnistudio for Managed Packages. For Omnistudio on standard runtime, see Omnistudio Help.
For details about the operators and functions that you can use in formulas, see Function Reference (Managed Package).
If a variable name contains spaces or non-alphanumeric characters, enclose the variable name in double quotes and precede it with var: in formulas. For example, if the JSON node name is Primary Guardian, specify it in formulas as var:"Primary Guardian".
If the name of a custom field includes special characters, sometimes you can't reference the field in a formula.
Before Winter '20, the result of a LIST function in a formula was saved to a VLOCITY-FORMULA-LIST node under the Formula Result Path. Beginning with Winter '20, the result is saved directly under the Formula Result Path.
To create a formula:
- In the Data Mapper Interface page, go to the Formulas tab.
- Click Add Formula. An empty formula is added to the list.
-
In the Formula field, specify the desired logic. For
example, to determine the total price of the items being purchased by a customer,
enter a formula such as:
SUM(Products:Price)You can reference attributes in formulas. Use the code (not the name) preceded by @. For example:Overview of Attributes
Account:@GoldStarAccount == "On"You can also use relationship notation in formulas to reference fields in a parent object. See Relationship Notation versus Multiple Extract Steps (Managed Package).
- In the Formula Result Path field, specify a JSON node in which to store the formula result.
-
Map the result to the final output.
- For an Extract Data Mapper, on the Output tab, map the formula result to the output structure. Use a colon (:) to delimit levels in the input and output paths in mappings.
- For a Transform Data Mapper, on the Transforms tab, map the formula result to the output structure. Use a colon (:) to delimit levels in the input and output paths in mappings.
- For a Load Data Mapper, for each sObject that you want to update, on the Fields tab, map the formula result to the field that you want to update.
- Load: For each sObject that you want to update, go to its Fields tab and map the formula result to the specific field that you want to update.

