Header Ads Widget

Ticker

6/recent/ticker-posts

How to Pass Data from OmniScript to Flexcard in Salesforce

 How to Pass Data from OmniScript to Flexcard in Salesforce

Hi , guys if you are beginner on vlocity and curious about how to pass data from omniScript to flexCard or vise-versa, so you are on right place.

Here one situation, where we have multiple steps in OS and suppose having Review Page at the end to show what user filled all data in each steps  & need to show all data on Review page .
So in such case scenario we generally use FlexCard's to show all user data .
Now what we gonna do , we create on Single Flex Card and show each step data using single flexcard.
Let's get Started.

Pass Data From OS to FC in salesforce

In the above example , we have Account & Opportunity steps , and One review Page to show data as a Summary.

Pass Data into fc from os in salesforce

FlexCard need to prepare like this :- 
For each step there will be each state need to create in FlexCard for summary Page.

Now we need to create Set Values for passing Data in FlexCard from OmniScript.
Passing Data in FlexCard from its OS Fc element's properties.

Set Values for Passing data from OmniScript to FlexCard

Suppose You need to pass many attributes from OS or input , in such case need just single string, passed from OS in parent-attribute.
Ex:- 
parent-attribute - %attributeName%

But in our case we need to get data from step or records .So the properties of Element will be.

parent-data : true
records : %attributeName%
parent-attribute : %conditionalStepNameAttribute%


Firstly we need to set Data value in Set Value element before steps.




By declaring :- 

getAccountInfo  :  %Account% - We are Storing Account Step Data record as String Json
same as with getOpportunityInfo

By declaring  :- 

AccInfo : {"stepName":"Account"} , this will pass in parent-attribute .

(Here we can send multiple attribute in a single string like this:-
 
AccInfo : {"stepName":"Account" ,"Type":"New","Condition":"Red"}
                                          OR

(If your data is coming from Any IP Or Extract Dataraptor you can send that values as well like this approach.)

AccInfo : {"stepName":"%stepName%" ,"Type":"%type%","Condition":"%condition%"}



These set value we will pass into records section. (getAccountInfo  :  %Account%)

Now for showing each steps in flexCard , we need to set parent-attribute to show steps as conditionally. 

Mapping will be like this:-


Now, we will get these data into Flexcard by having prefix :- parent.attributeName

Just add Condition on each state in FlexCard as Parent.StepName =Account /Opportunity


Also , make sure in FlexCard the fields output Name will be Step's Field Name , so it will get Step value in flexCard.
Here in field's properties output name will be same as step field name.

Imp :- Make sure you set your Set Value just Before Review Page So you will get Data in your set Values , otherwise json node will be empty if you set before steps.

Output :-





    Hope , this will helps you , thanks for reading this article .

Post a Comment

0 Comments