top of page
OmniStudioFactBg.png
  • Writer's picturePuja Kumari

Passing Data From FlexCard to LWC OmniScript

Updated: Mar 9, 2023

There are two ways to launch an Omniscript from a FlexCard:

  1. Add an Omniscript as a Custom LWC.

  2. Launch an Omniscript from an action

Let's see how to pass the data to the Omniscript in each of the above methods.

  1. Passing data from FlexCard to the Omniscript when the Omniscript is added as a Custom LWC:

a. In this method, the data will be passed on a load of the OmniScript using an attribute called recordId.


b. Here we are sending all the data in the FlexCard via {record} context variable

c. To retrieve the passed data in the OmniScript we have to use ContextId variable

d. For example:

i. If the data in the flex card is:

{

"providerId":"99999999",

"AccountId":"88888888",

"ContactId":"77777777"

}

ii. If we have to access the providerId value in the OmniScript, we can fetch it as %ContextId:providerId%.

iii. Similarly, if we need to access AccountId and ContactId, then in the OmniScript we need to use it as %ContextId:AccountId% and %ContextId:ContactId% respectively.



Limitations:

  1. We can send the data only via the attribute called recordId.

  2. We can retrieve the data passed in the Omniscript only through the variable ContextId.


2. Passing data from FlexCard to the Omniscript when the Omniscript is launched from a FlexCard Action:

a. We can launch an OmniScript from an OmniScript Action element on a FlexCard as below:

i. From the FlexCard Designer, drag an Action element into a state.


ii Select “Action Type” as Flyout or Omniscript.

iii. If Flyout is selected, select the Flyout Type as “OmniScripts” and in the “Flyout” select the OmniScript to be launched.


iv. Pass the parameters to the omniscript as the Key Value under the Attributes.

v. In the Omniscript we can retrieve the passed value with the name of the Key, for example %LaunchedFrom%

References:

8,480 views0 comments

Recent Posts

See All

Using Formulas in Dataraptors

To get the data in the desired format and add this to the output node, Formulas are defined. Supported DataRaptors: Extract, Transform, and

Remote Action In Omnistudio

Remote actions call an Apex class from FlexCards, OmniScripts, or Integration Procedures. Apex Class should be global with sharing to...

OmniStudioFactFooterBg.png
logo.png

OmniStudiofacts helps us to build a Vlocity/OmniStudio Tech Community which focuses on sharing technical skills and experience across the globe.

© 2023 by OmniStudioFacts.

bottom of page