You are here:
Pass Data to Flexcards by Using Events
When an event occurs, a notification is sent to a Flexcard through an action on an element. Then, execute an action based on the event. Set up events to communicate between a child Flexcard and its parent, between an element and the Flexcard that it's on, or between distinct components. For example, add an action on an embedded child Flexcard that, when clicked, updates a field on the parent Flexcard. Or, add an action on an image that when clicked, updates a merge field value in a text element.
-
After you select the event action type, select the event type:
- Custom: Notify events between a child and its parent, such as a child Flexcard and its parent Flexcard, or an element and the Flexcard that it’s on.
- PubSub: Notify events between distinct components, such as between Flexcards.
-
Enter an event name. Don’t use a reserved name.
To register dynamic events based on a parent attribute or a session variable, use these context variables:
{Parent.attr}: Use an attribute passed to a child from its parent Flexcard such asevent_{Parent.closed}.{recordId}: Use the ID of the record page that the Flexcard is on such asaccountEvent_{recordId}.{Session.var}: Use a stored value defined as a session variable of the Flexcard, or a public property defined as an exposed attribute of the Flexcard such aschnnl_{Session.tab}.
-
For pubsub events, enter a channel name with the same criteria as for the event name.
By default, the channel name is the Flexcard name.
-
For custom events, consider how the event passes through elements and select the checkboxes
accordingly:
- When you trigger a custom event from a nested element such as a block, select Bubbles.
- When components communicate with each other, such as a child Flexcard and its parent, or a Flexcard and the parent Omniscript, select Bubbles and Compose.
-
To pass contextual data, add an input parameter.
- In Key, enter a variable name.
-
In Value, enter the variable value.
Avoid using [] or <> brackets in value or user input fields. These characters can cause issues when sending pubsub events between Flexcards, as they are interpreted as merge fields, leading to data corruption.The Value field supports concatenated strings including a combination of plain text and supported merge fields, such as
{Parent.type} > {Name}, and the{Session.var}context variable.
- Flexcards Reserved Event and Channel Names
Review the event names and channel names that are reserved for specific purposes and use cases. - Example Use Cases for Flexcard Events
Review examples of Flexcard event setup for common use cases such as updating a product list, registering dynamic custom events, or resetting a user selection.

