Salesforce OmniStudio DataRaptors for developers

Salesforce OmniStudio DataRaptors are used to efficiently read, transform, and write Salesforce data. They essentially supply data to OmniScripts and Flex Cards from Salesforce and write updates from OmniScripts and Flex Cards back to Salesforce. Typically, they do this via OmniStudio Integration Procedures and are one of the primary components of OmniStudio's Service Management layer.

There are four types of OmniStudio Data Raptors, each with their own unique purpose and usage scenarios³⁴:
1. DataRaptor Turbo Extract retrieves data from a single Salesforce object type with support for fields from related objects. Users can filter the data and select the fields to return⁴.
2. DataRaptor Extract is ideal for complex data extraction scenarios³.


A DataRaptor Load saves updates to records in Salesforce by either overwriting existing data or creating new records if that data doesn't yet exist. This process of updating or inserting records is called upsert

DataRaptor Loads accept data in JSON, XML, or custom input formats and write the data to Salesforce objects. Formulas and attributes are supported. For example, when a user running a case-handling OmniScript finishes entering data and clicks Save, the script calls a DataRaptor Load to record the data entered.

To use a DataRaptor Load, you need to go to the OmniStudio app and select DataRaptors from the drop-down menu. Then, click on new from the type dropdown and select the dataraptor you want to use. In this case, you will select Load.

The DataRaptor Load applies its mappings and formulas to the input data to create the output data, then loads the output data into Salesforce objects according to the mappings.

In the context of DataRaptor Load, mappings refer to the way data is mapped from the input data to the Salesforce objects. The DataRaptor Load applies its mappings to the input data to create the output data, then loads the output data into Salesforce objects according to the mappings.

Formulas are used to perform calculations or transformations on the data before it is loaded into Salesforce objects. DataRaptor Loads accept data in JSON, XML, or custom input formats and write the data to Salesforce objects. Formulas and attributes are supported.


A DataRaptor Extract is used to read Salesforce data and return results in JSON, XML, or custom formats. Users can filter the data and select the fields to return. DataRaptor Extract also supports Formulas, default values, and translations, while extracts typically provide OmniScripts, Integration Procedures, and Cards with the required data. 

To create a DataRaptor Extract, you need to use the OmniStudio DataRaptor Designer, which you can access via the OmniStudio DataRaptors tab in the OmniStudio app

To use a DataRaptor Extract, you need to go to the OmniStudio app and select Dataraptors from the drop-down menu. Then, click on new from the type dropdown and select the dataraptor you want to use. In this case, you will select Extract. 

When you build a DataRaptor Extract, you need to specify the Salesforce object (sObject) that you want the DataRaptor to query, set the filters that determine the data retrieved from the object, and specify the fields to extract. 

To create a formula in a DataRaptor, you need to use the Formulas tab in the OmniStudio DataRaptor Designer, which you can access via the OmniStudio DataRaptors tab in the OmniStudio app. 

Most types of DataRaptors—Extract, Transform, and Load—support formulas. To define a formula, specify the desired transformation and the location in the Extraction Step JSON where the output resides. Use the Formula field to specify the desired logic

To use formulas in a DataRaptor Extract, you need to use the Formulas tab in the OmniStudio DataRaptor Designer which you can access via the OmniStudio DataRaptors tab in the OmniStudio app.

On the Formulas tab, you define formulas. When you define a formula, you map its output to the output JSON (for extracts and transforms) or Salesforce object field (for loads). Use the Formula field to specify the desired logic. 


Here are some examples of formulas that can be used in DataRaptors:

Concatenation: You can create a formula to concatenate (join together) two or more fields using the CONCAT function. For example, you can concatenate the city_name and state_code fields to display them together on one line. 
Mathematical operations: You can use formulas to perform mathematical operations on numbers, such as addition, subtraction, multiplication, and division. For example, you can multiply the number of texts sent by the rate per text to get a total amount for a cell phone bill³.
Logical operations: You can use formulas to determine a result based on logic. For example, you can use an IF function to return a value of "Minor" if the customer is less than 18 years old, and a value of "Adult" otherwise. 


To use formulas in a DataRaptor Extract, you need to use the Formulas tab in the **OmniStudio DataRaptor Designer, which you can access via the **OmniStudio DataRaptors tab** in the **OmniStudio app**.

On the Formulas tab, you define formulas. When you define a formula, you map its output to the output JSON (for extracts and transforms) or Salesforce object field (for loads). Use the Formula field to specify the desired logic.


No comments:

Powered by Blogger.