Salesforce OmniStudio is a versatile tool designed to quickly develop and implement digital and industry-specific experiences across various platforms. With OmniStudio’s drag-and-drop configuration capabilities, customers create guided brand experiences specific to their industry with clicks rather than custom code.
One of the essential tools in OmniStudio is DataRaptor, which is used to Transfer and Transform Data b/w Salesforce and other tools in the platform.
A DataRaptor is a mapping tool that enables you to read, transform, and write Salesforce data.
Think of it this way: for every digital customer interaction or business process, your system must extract data to display it. When the user changes that data or enters new data, it must be saved too. That’s where OmniStudio DataRaptors come in. There are four types of DataRaptor:
DataRaptor Turbo Extract: The DataRaptor Turbo Extract allows you to retrieve data from a specific Salesforce object type, including fields from related objects. You can filter and choose the fields to include in the output. However, it doesn't support formulas, and there's no Output tab for mapping the output structure.
DataRaptor Extract: DataRaptor Extract, the second type of DataRaptor pulls data from Salesforce, reads Salesforce data and returns results in JSON, XML, or custom formats via complex field mappings. You typically use DataRaptor Extracts to provide OmniScripts and FlexCards with any internal Salesforce data they need to display. They support formulas and complex output mappings.
DatarRaptor Load: DataRaptor Loads are responsible for transferring data from JSON or XML input to Salesforce objects. They not only update existing records with modified information but also simultaneously generate new records.
DataRaptor Transform: Manipulates any data that comes from inside or outside Salesforce. DataRaptor can convert information from JSON to XML and vice versa, This tool also helps in restructuring input data by renaming fields to meet specific needs. It can substitute values in different fields, offering a powerful solution for manipulating and customizing data according to specific requirements.
To set up DataRaptors, you use the OmniStudio DataRaptor Designer, which is accessible through the OmniStudio app's DataRaptors tab. This designer has tabs that help you define the actions you want to perform. It's like a control center where you specify how you want your DataRaptor to work.
1. Extract Tab: The extract tab is used to specify the Salesforce objects you want the DataRaptor to query and the filters that determine the data to be returned from the object.
2. Formulas Tab: The Formulas tab is used to define formulas. Three types of DataRaptors (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).
3. Output Tab: The Output tab is used to map data from the extract step JSON to the output JSON.
4. Options Tab: The Options tab sets advanced options such as whether to check the user's access permissions for the fields before executing the DataRaptor. Set the Platform Cache Type to Session Cache for data related to users and their login sessions, or Org Cache for all other types of data. The Time to Live in Minutes setting determines how long the data remains in the cache.
5. Preview Tab: The Preview tab is used to test the output of the DataRaptor. You provide input parameters as Key/Value pairs and then click Execute. The result is displayed in the Response section.
Let’s take an example to fetch Accounts & Primary contacts related to the Accounts through DataRaptor Extract.
1. Go to the OmniStudio DataRaptors tab and click new.
2. Fill in all the required fields & click Save.
3. In the Extract tab, Click on Add Extract Step.
4. First, select the Object from where we want to fetch data. In the Extract output path give the name of the List in which we have to store all the data which is fetched from the Object. In Filter define any type of filter for the data.
5. As we can Fetch data from multiple objects whether objects are related to each other or not through DataRaptor extract, we will add one more extract step for Contact records related to the Account we fetched above.
6. Go to the Formula tab if you want to add any formula for the data that you fetched in the Extract tab. For eg. I have written a formula to get the record count for both lists separately and saved the count in Formula Result Path.
7. In the Output tab map the fields for both the Objects for which you want to show data in the output.
8. Go to the Preview tab click on the Execute button and in the Response section you will have your data & you can see all the fields in the data that you have mapped in the output tab and also the Record count for both the lists that you added in the formula tab.
DataRaptor empowers you to extract relevant data from Salesforce efficiently. Whether you’re building custom reports, integrating with external tools, or enhancing user experiences, DataRaptor is a versatile solution.
Remember to explore additional features and use cases within OmniStudio to maximize its potential. Happy extracting! 🚀
For more detailed information, refer to the official Salesforce documentation on OmniStudio DataRaptors.