Header Ads Widget

Ticker

6/recent/ticker-posts

How to use type ahead block in Omniscript | How to fetch data from extract DR and pass into typeahead in Salesforce

How to use type ahead block in Omniscript | How to fetch data from extract DR and pass into typeahead in Salesforce

Hi, friends welcome back once again, today in this blog will see how to use type ahead block in omniscripts and fetch data from dataraptors and pass into type ahead block and fetch data according to selection of typeahead.


What is type Ahead blocks in Omniscripts ?

First we have to understand what we can do with typeahead blocks in Omniscripts , generally from type aheads we can use for selection of records like drop down , or for searching any records , just like global search in our salesforce it retrieve data from back end , same we can do with this type ahead. 
A very useful element we can say in OmniScripts to fetch or search data or acts like a lookup field, that is nothing but Type Ahead Block in OmniScripts.

Scenario / Use case :- User wants to get all information of account as he selects account names from step , on next step all account details should be displayed.

For this we generally creates one OmniScript and create one Step for Selection of Accounts.

Type Ahead Block in OmniScripts


Now , how we can get the all account list into type Ahead drop down. For getting this list we need one extract dataraptor.

Type Ahead Block in salesforce



How extract dataraptor is use in Vlocity?

So, for fetching the data , we will use one Extract dataraptor and use it before the step.

How to use Extract DataRaptor in vlocity

Here we are querying all accounts on account object. by using '$Vlocity.Null' , we can use this null check query in vlocity dataraptors , and into output we need just account name only .


Extract DR in vlocity

Now , from this query we will get all accounts name, we can use limit as well in query like limit 10,15 records that will be good.
Now , we have to get this response of dataraptor into omniScript.

How to get reponse from Extract dataraptor into omniScript.

For getting response of extraxt dataraptor , we can get in form of Json node or Json Path as well. So into the properties of Dataraptor we can declare our response node.
Here we declared our response in Result.

How to get reponse from Extract dataraptor

Now will get data in form of Json node like structure , for example :- 
{
    "Name": "Acme",
    "AnnualRevenue": 22000000,
    "Phone": "(212) 154-6450",
    "Type": "Customer - Direct",
    "Industry": "Other"
  },

Now using set values we can define that response and get the full response of dataraptor in Omniscript.
We can set the values like :-

allAccNames : %Result:accName% 

Here we are getting Node of accName in Result Node , so it will get all name in allAccNames.

Now we can use our Type Ahead block in Step and into properties , just check the Use Data JSON checkbox , and provide node path into the field as we already have in our set value as allAccNames , so will use it.
Type Ahead Block properties in vlocity


Here we are setting the json path for type ahead block in drop down. Now we done our half job, need to pass this selected account Name to fetch details of particular Account to show on another step.
Our type Ahead Block now will fetch data of all accounts name.
type ahead block in salesforce how to use it


For sending data from TypeAhead and getting all account details we need another Extract dataraptor for this ,before sending we have to again define our response from Type Ahead into set values , then will pass into Dataraptor as a input .
sending data from type ahead into dataraptor

accountName: %SelectAccount% now this SelectAccount is the name of that type ahead block and we are setting up into set values so later will pass into dataraptor as an input parameter.

How to pass input parameter into Extract dataraptor from OmniScript?

We can pass single or multiple input parameter in dataraptor from omniScript ,in our case we need only single input parameter.
Now we already set our set value ,need to pass that accountName as an parameter of extract dataraptor from OmniScript itself.
How to pass input parameter into Extract dataraptor from OmniScript

Now we will query on account as per this input and get all fields of account . Once we get the response from this Dataraptor , again we need to set the response node into the properties of this dataraptor and set it to into set values.
Important :- If you need to get the data from extract data raptor into step , means all field value should be populated into step  then make sure your stepName and fields value are same as per your output path of your dataraptor.
For example :-



Now Our Step fields should be same as Output JSON Path name of fields.
getting response from dataraptor into omniScript

Great work, we did all setps perfectly until now . Now just preview your OmniScript if you did all steps carefully , you will get your account details into steps from your selected account name from Type Ahead.
I'm adding output for you guys!

Output :- 




That's all for now . Hope it helps you to learn Type Ahead Blocks, Dataraptors & OmniScripts, if you have any query feel free to comment your questions.

Thanks !!

Post a Comment

0 Comments