OmniScript – OmniStudio

When we talk about OmniStudio then first thing that comes to mind is the OmniScript. When I started learning OmniScript (when it was part of Vlocity Managed Package), I was simply thrilled. Creating a guided process was never that easy. I remember writing thousands of lines of APEX and Visualforce code and then writing very complex Aura Components to create a guided experience for our business user.

Last couple of years Salesforce has made lot of investments in Lightning flow and creating simple guided flow is now relatively easy. Today Salesforce offers Salesforce Lightning Flow and OmniStudio OmniScript. They are exceptional tool to create guided process. We can have a separate thread to discuss why do we need two separate tools for guided process and which one we should use. This article I am going to cover OmniScript

OmniScript is a very powerful tool to design a guided process. You do not need any APEX or coding skill to create a sophisticated guided process. You may not be requiring APEX but you definitely need knowledge of DataRaptor and Integration Procedure. I would recommend spending some time on DataRaptor and Integration Procedure before exploring OmniScript.

OmniScript provides comprehensive list of components to create a great guided process. I would list down few of these components below and I would encourage you to explore all the components. You can use Salesforce documentation to understand the usage of these components.

To learn OmniScript lets create a simple OmniScript that would have four steps as listed below: –

  • First Step to capture basic details of new employee
    • First Name
    • Last Name
    • Email Address
    • Phone Number
  • Second Step to capture Address and Education Details
    • Street Address
    • City
    • State
    • Zip Code
    • Country
  • Third Step to show summary of data captured in first two steps
  • Fourth step to show a confirmation message that a new employee record is created

Solution Outlines

We got a requirement to create a simple guided process for new employee onboarding. First thing that we normally do is to create a high-level solution that outlines what all components we would be requiring to complete the development. I have listed out what all we are going to use here: –

  • New OmniScript with name, type and subtype
  • Add a step element to OmniScript
    • Add a text element for First Name
    • Add a text element for Last Name
    • Add an email element for Email
    • Add a Telephone element for Phone
  • Drag a second step element to OmniScript
    • Add a text element for Street Address
    • Add a text element for City
    • Add a text element for State
    • Add a select element for Country (It can be text but I am assuming we need only two values “USA” and “Canada” so we can use Select element)
  • Drag one more step element to OmniScript for Summary. It would have elements similar to first two steps but all the elements would be read only and will be defaulted to element name from first two steps (I would share the details below). You can also use block elements to display the fields in two blocks for better formatting
  • Add one more step to display a confirmation message to user that new employee is added to System. This step you can use Text Block element to display the message
  • Use the preview button to simulate your OmniScript and verify all the steps looks good
  • Well, we also need something in our OmniScript to create a new employee record (actually a contact record we can assume). It means we need to create a new DataRaptor Post action and need to use that between 3rd step and 4th step. I assume you know how to create a DataRaptor Post so go ahead and create one DataRaptor. You need sample JSON to create DataRaptor so I would suggest simulating your OmniScript and copy JSON and use that in DataRaptor. Also as a recommended practice we would create an Integration Procedure and that Integration Procedure would be using DataRaptor to create Employee record and it would be returning Employee Id of new employee record in JSON node “EmployeeId”

Well, now we know what we have to do and how we have to do. So go ahead and start building your first guided process for employee onboarding. I am going to add some screenshots that you can use as reference. Once your OmniScript is ready you can place it on record page or community page. You can call it different ways. I am not going to cover the OmniScript activation and execution in this article.

New OmniScript

First Step: Employee Details

TypeNameField LabelRequired
TEXTFirstNameFirst NameTrue
TEXTLastNameLast NameTrue
EMAILEmailEmailTrue

Second Step: Employee Address Details

TYPENAMELABELREQUIRED
TEXTStreetAddressStreet AddressTrue
TEXTCityCityTrue
TEXTStateStateTrue
TEXTZipCodeZip CodeTrue
SELECTCountryCountryTrue

Third Step: Summary Data

TYPENAMELABELREAD ONLYDEFAULT VALUE
TEXTsummaryFNFirst NameTrue%FirstName%
TEXTSummaryLNLast NameTrue%LastName%
EMAILSummaryEmailEmailTrue%Email%
TELEPHONESummaryPhonePhoneTrue%Phone%
TEXTSummarySAStreet AddressTrue%StreetAddress%
TEXTSummaryCityCityTrue%City%
TEXTSummaryStateStateTrue%State%
TEXTSummaryZipcodeZip CodeTrue%ZipCode%
SELECTCountryCountryTrue%Country%
BLOCKSummaryDetailsEmployee DetailsN/AN/A
BLOCKSummaryAddressEmployee AddressN/AN/A

Fourth Step – Confirmation

As you would have understood, there are lot to learn in OmniScript and only way to learn is to create an OmniScript and start adding each steps and explore each of the properties. There are some easy elements like TEXT, Email, Phone etc.. while we have elements in Lookup, Repeating Components and several actions that require lot of study and exploration.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top