Vlocity Facts #05 | OmniStudio - DataRaptor Transform

 DataRaptor Transform Overview

Without reading or writing to Salesforce, DataRaptor Transforms allow you to conduct intermediate data transformations. We can use formulas to modify the data according to the requirement. 

Create a DataRaptor Transform

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

  • Interface should be Transform
  • Input Type should be either JSON, XML, Custom.
  • Output Type should be JSON, XML, PDF, DOCSIGN, Document Template, Custom.

Configure a DataRaptor Transform

In DataRaptor Transform we are having 4 tabs [ Formula, Transform, Options, Preview]. In Transform we are not having tabs like Extract or Objects.

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: For converting the Data into LOWER or UPPER case
  • Scenario 4: 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.
Transform Tab - It Used to map the Input type[ json, xml, custom] with output type [json, xml, pdf, docusign, custom] what you have choose while creating the dataraptor transform. Based on your Input type and Output type the path name changes in the Transform Tab. You can map the Input and output path in Transform Tab.

If you have Input Json/xml copy that and paste in Input json and if you know the excepted output copy the json/xml and paste in Excepted Json output.  



By using Quick match we can map  the Input path and output path easily.

Drag and drop mappings to pair them or select an input and output mapping and click "Pair".


Options Tab - In options tab we have some Optional properties [ Time To Live In Minutes,  Salesforce Platform Cache Type, 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.
  • 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 DataRaptor Transform?
 
You can DataRaptor Transform in multiple ways.

  • For example in your omniscript you have 4 steps in 5th step you need to display the details like preview mode. For this type of requirement you can use dataraptor transform.
  • For converting Json - Xml and Xml - Json.
  • For converting the data into Pdf, Docsign, Document template format.
  • For restructuring the input data and renaming field.
In Transform tab while you are mapping Data type checkbox field  Input to Output and you need to change the values. You can follow this process
  • Open the mapping and add entries to the Transform Map Values list to replace one value with another. Create the following entries if the incoming field has TRUE or FALSE and your OmniScript expects a Proceed or Pause value:

In Upcoming Post we can discuss how to use DataRaptor Transform and PDF Action .


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]