Vlocity Facts #04 | OmniStudio - DataRaptor Extract

DataRaptor Extract Overview

DataRaptor Extract, is used to pull the data from Salesforce, reads Salesforce data and returns results in JSON, XML, or custom formats via complex field mappings.You can filter the data and select the fields to return. Use DataRaptor Extracts to provide OmniScripts and FlexCards with any internal Salesforce data they need to display.

Create a DataRaptor Extract

For Creating a DataRaptor Extract you need to mention Interface Type, Input Type, Output Type, Required Permission (optional), Description (optional)  

  • Interface should be Extract
  • Input Type should be either JSON, XML, Custom.
  • Output Type should be JSON, XML, Custom.
Configure a DataRaptor Extract

In DataRaptor Extract we are having 5 tabs [ Extract, Formula, Output, Options, Preview]

Extract - It is used to select the SObjects for which you need to Extract the data.
  • By clicking Add Extract Step you can select the source object from the drop-down list.
  • Extract Output Path - This Path defines the JSON extraction step where the data should be stored.
  • Interface Field API Name - Here you can select the source object field related to object which you have selected in Extract Step.
  • Matches - We can use these matches in filter condition [ =, <>, <, >, <= , >=, ~=, Like, Not Like, Includes, Excludes]
  • Filter - By adding additional filters we can trim the data exactly what we need.
    [ AND, OR, LIMIT, ORDER BY, OFFSET ]


Formula Tab 
- We can use formula tab for the following scenarios.  
    Scenarios

  • Scenario 1: To combine 2 fields and load the data into particular field.
  • Scenario 2: To Calculate the sum of child records and update the value in parent record.
  • Scenario 3: We can use If expression - If(%Expression%, true, false), for example, based on age we need to update the category field like Adult, Minor at that time we can use If function.
    After writing Formula and mentioning the formula result path, you can use Formula result path in Input Json path under Fields tab.
Output Tab -  OutPut Tab is used to map the data from the object you selected in Extract Tab - you will choose the fields in EXTRACT JSON PATH and you will map with OUTPUT JSON PATH by mentioning the element name. The element name what you have mention in OUTPUT JSON PATH is used in omniscripts, flexcards or Integration Procedures. 

Options Tab - In options tab we have some Optional properties [ Time To Live In Minutes,  Salesforce Platform Cache Type, Check Field Level Security, Overwrite Target For All Null Inputs].
  • Time To Live In Minutes - Determines how long data remains in the cache if data caching is enabled. The minimum value is 5.
  • Salesforce Platform Cache Type - It is used to Enables data caching, We have 2 options session cache which is used to cache the data related to the users and their login sessions and org cache is used for all other types of data.
  • Check Field Level Security - It is used to check the user access permissions for the fields before executing the DataRaptor.
  • Overwrite Target For All Null Inputs - Ensures that an output node is created regardless of whether a field is null.
Preview Tab - This Preview tab can be used to check the excepted output by passing the Key/Value pair or Json. We can also check the error in Debug logs if Dataraptor fails.

When to Use Multiple Extract Steps?

The number of extract steps required is determined by the relationship of the object types being extracted from. Single, single with relationship notation, and multiple are the scenarios.
  • If you need to extract the data from single object then you need only one extract step. For example if you need to extract data from Account then only one extract step is required.

  • If you need to extract the data from primary object and other parent objects also requires only one extract step. For example extracting Contact with some Account data for each contact this can be done by using Relationship Notation versus Multiple Extract Steps.



  • If you need to extract the data from primary object and one or more child objects it requires minimum 2 extract steps. For example if you are extracting data from Account and you need to extract all the contacts associated with that account. 
DataRaptor Extracts Example scenario:

In salesforce reports Up to four objects may be linked in a report type. But you have a use case where you need to display the data from 9-10 objects which are linked directly or Indirectly at that time you can use dataraptor extract and flexcard to display the data 
  • DataRaptor Extract - we need to create 2-3 dataraptors extract because a good practice is to use 3 or fewer objects in Extract tab.
  • Flexcards - By using Data Table element in flexcard you can display the data.


Reference diagram how objects are linked

For more Details about DataRaptors and Types check this link DataRaptors

Comments

Popular posts from this blog

Vlocity Facts #01 | OmniStudio DataRaptors

Vlocity Facts #34 || Getting the details from the URL in a FlexCard and an Omniscript

Vlocity Facts #44 || Communication between Omniscript and Flexcard [Pub/Sub]