Introduction

In today’s dynamic CRM landscape, businesses need efficient tools to handle data extraction, transformation, and loading processes. OmniStudio DataRaptors are powerful declarative tools that allow developers and administrators to manipulate data within Salesforce without writing code. This tutorial provides an in-depth understanding of DataRaptors, their types, use cases, and best practices to help you leverage their full potential.

What are OmniStudio DataRaptors?

OmniStudio DataRaptors are configurable services within Salesforce that enable you to perform CRUD (Create, Read, Update, Delete) operations on Salesforce data without writing Apex code. They are part of the OmniStudio toolset and are essential for building OmniScripts and FlexCards, allowing seamless data interaction between the user interface and Salesforce databases.

Key features of DataRaptors include:

  • Declarative Configuration: Build data operations through a point-and-click interface.
  • Flexibility: Handle complex data transformations and mappings.
  • Performance Optimization: Efficiently retrieve and manipulate data with minimal server calls.

Types of DataRaptors

OmniStudio offers four types of DataRaptors, each designed for specific data operations.

Overview of DataRaptor Types

DataRaptor TypePurpose
DataRaptor ExtractRetrieves data from Salesforce objects.
DataRaptor LoadWrites data to Salesforce objects.
DataRaptor TransformTransforms data without interacting with Salesforce databases.
DataRaptor Turbo ExtractHigh-performance data retrieval with simple configurations.

DataRaptor Extract

The DataRaptor Extract is one of the tools in Salesforce OmniStudio that allows users to extract data from Salesforce objects or external sources without writing any custom code. It is a declarative way to specify what data to extract, how to map and where you want the data to be sent with its only use case being OmniScripts, FlexCards and integration procedures which simplifies the process of data retrieval.

  • Purpose: To fetch data from Salesforce objects and return it in JSON, XML, or custom formats.
  • Use Cases: Retrieving customer information, product details, or any data needed for display in OmniScripts or FlexCards.

DataRaptor Load

DataRaptor Load is a powerful tool in Salesforce OmniStudio, DataRaptor Load, which allows you to insert or update or delete data into Salesforce objects / external systems without using the custom code. A way of doing this is creating declarations for data operations, associating input data with target fields, and handling complex logic to transform the records. That makes it easier to manage the data flow between elements within applications (OmniScripts, FlexCards and Integration Procedures).

  • Purpose: To write data to Salesforce objects by inserting, updating, or upserting records.
  • Use Cases: Saving user inputs from forms, updating account records, or creating new records based on user interactions.

DataRaptor Transform

DataRaptor Transform is a key feature within Salesforce OmniStudio that enables manipulation and transformation of data in the extraction or loading stages without any custom code. It offers a high-level declarative standard way to specify complex transformations which includes things like calculations, conditional logic and data formatting so that the transformed data conforms more closely with business needs/goals before it is used or stored. These ensure that data is consistent, accurate and usable in multiple applications such as OmniScripts, FlexCards or Integration Procedures.

  • Purpose: To transform data from one format to another without database interaction.
  • Use Cases: Modifying data structures, applying formulas, or preparing data for integration with external systems.

DataRaptor Turbo Extract

  • Purpose: A streamlined version of DataRaptor Extract for simple, high-performance data retrievals.
  • Limitations: Supports only a single Salesforce object, no formulas, and no complex mappings.
  • Use Cases: Loading data for FlexCards where performance is critical.

Use Cases for DataRaptors

DataRaptors are versatile and can be used in various scenarios:

  • OmniScripts: Guide users through complex processes by fetching and saving data seamlessly.
  • FlexCards: Display contextual information efficiently using data retrieved by DataRaptors.
  • Integration Procedures: Optimize data operations by combining multiple DataRaptors.
  • External Integrations: Prepare and transform data for external systems or APIs.

Creating and Configuring DataRaptors

Prerequisites

Before creating DataRaptors, ensure you have:

  • Access to a Salesforce org with OmniStudio installed.
  • Necessary permissions to create and edit DataRaptors.

General Steps

The process of creating a DataRaptor involves:

  1. Defining the DataRaptor (Name, Type, Description).
  2. Configuring the DataRaptor settings.
  3. Defining data mappings and transformations.
  4. Testing the DataRaptor to ensure it works as expected.

Creating a DataRaptor Extract

Step 1: Define the DataRaptor

  • Navigate to OmniStudio DataRaptors in Salesforce.
  • Click New and select DataRaptor Extract.
  • Enter a Name, Namespace (if applicable), and a Description.

Step 2: Configure Extract Settings

  • Input Parameters: Define any inputs required (e.g., Record IDs).
  • Output Format: Choose JSON, XML, or custom formats.
  • Extract Output Path: Set the JSON node where the output will be stored.
Creating a DataRaptor Extract

Step 3: Define Data Source Objects

  • In the Extract tab, click Add Extract Step.
  • Select the Salesforce Object (e.g., Account).
  • Define Filters to retrieve specific records (e.g., Id = RecordId).

Step 4: Map the Fields

  • Under Extract Mapping, map the Salesforce fields to output JSON nodes.
Salesforce FieldOutput JSON Node
NameAccountName
PhoneAccountPhone
IndustryAccountIndustry

Step 5: Add Filters and Conditions

  • Use Filter Conditions to limit data retrieval (e.g., Active__c = true).

Step 6: Test the DataRaptor

  • Save the DataRaptor.
  • Click Preview.
  • Provide test input values.
  • Run the test and verify the output.

Creating a DataRaptor Load

Step 1: Define the DataRaptor

  • Navigate to OmniStudio DataRaptors.
  • Click New and select DataRaptor Load.
  • Enter a Name, Namespace, and Description.

Step 2: Configure Load Settings

  • Upsert Key: Specify the field used for upsert operations (e.g., Id).
  • Is Upsert: Enable if performing upsert operations.
  • Batch Size: Set batch sizes for bulk operations if necessary.

Step 3: Map the Fields

  • In the Load tab, click Add Load Step.
  • Select the Salesforce Object (e.g., Contact).
  • Map the input JSON fields to Salesforce fields.
Input JSON PathObject Field
FirstNameFirstName
LastNameLastName
EmailEmail

Step 4: Test the DataRaptor

  • Save the DataRaptor.
  • Click Preview.
  • Provide sample input data.
  • Run the test to check if records are correctly inserted or updated.

Creating a DataRaptor Transform

Step 1: Define the DataRaptor

  • Navigate to OmniStudio DataRaptors.
  • Click New and select DataRaptor Transform.
  • Enter a Name, Namespace, and Description.

Step 2: Configure Transform Settings

  • No specific settings are required; focus on mappings and formulas.

Step 3: Map Input and Output JSON Structures

  • In the Transform tab, define the Input JSON Path and Output JSON Path.
  • Map the input fields to output fields.
Input FieldOutput Field
PhoneNumberFormattedPhone
FirstName & LastNameFullName

Step 4: Use Formulas and Functions

  • Click on the Formula tab to add formulas.
Formula NameFormula Expression
FullNameCONCAT(FirstName, ' ', LastName)
FormattedPhoneFORMAT_PHONE(PhoneNumber, 'US')

Step 5: Test the DataRaptor

  • Save the DataRaptor.
  • Click Preview.
  • Provide sample input JSON.
  • Run the test and verify the transformed output.

Using DataRaptor Turbo Extract

Step 1: Define the DataRaptor

  • Navigate to OmniStudio DataRaptors.
  • Click New and select DataRaptor Turbo Extract.
  • Enter a Name, Namespace, and Description.

Step 2: Configure Extract Settings

  • Object: Select a single Salesforce object (e.g., Case).
  • Fields: List the fields to retrieve (e.g., CaseNumber, Status, Priority).

Step 3: Add Filters

  • Apply simple filters if necessary (e.g., Status = 'New').

Step 4: Test the DataRaptor

  • Save the DataRaptor.
  • Click Preview.
  • Provide any required input parameters.
  • Run the test to ensure data is retrieved correctly.

Note: Turbo Extracts are optimized for performance and do not support complex mappings or multiple objects.


Best Practices

To ensure optimal performance and maintainability, consider the following best practices:

  • Use Clear Naming Conventions: Start names with action verbs (e.g., ExtractAccountData) for clarity.
  • Limit Data Retrieval: Extract only the necessary fields to improve performance.
  • Reuse DataRaptors: Design modular DataRaptors that can be reused across multiple scripts or components.
  • Minimize Steps: Keep the number of extract or load steps minimal to enhance performance.
  • Avoid Complex Formulas in DataRaptors: For complex logic, consider using Integration Procedures or Apex.
  • Test Extensively: Always test DataRaptors with various data scenarios to ensure reliability.

Error Handling and Debugging

Effective error handling ensures a smooth user experience.

  • Use the Preview Tab: Utilize the Preview feature to test DataRaptors and view outputs and errors.
  • Check Debug Logs: Salesforce debug logs provide detailed error information for troubleshooting.
  • Implement Validations: Use field-level validations to prevent data issues before they occur.
  • Design User-Friendly Errors: Provide meaningful error messages to help users understand and rectify issues.

Conclusion

OmniStudio DataRaptors are powerful tools for efficient data management within Salesforce. By mastering their types and functionalities, you can create robust data processes without writing code. Adhering to best practices ensures optimal performance and maintainability.

With this knowledge, you’re well-equipped to leverage DataRaptors to enhance your organization’s data operations, improve user experiences, and streamline business processes.


Additional Resources


By structuring the tutorial with clear paragraphs, lists, and tables, this guide aims to enhance readability and provide a comprehensive understanding of OmniStudio DataRaptors. Use this resource as a reference to effectively implement DataRaptors in your Salesforce environment.