Fire Event

This action allows you to fire a custom event that has been defined in your application, flow, page or fragment, using the Events tab. A custom event can carry a payload that you define when you create the event, and the payload is passed to the event using the Fire Event action.

Here's a quick overview of how a custom event and the Fire Event action are used:
  1. Create a custom event, defining parameters if required.
  2. Create an event listener, which can start more than one action chain:
    1. Assign it the custom event
    2. Create a new action chain for the event, which is launched when the event is triggered. Create the action chain through the Event Listener tab, because if the listener's custom event has input parameters, the action chain is created with an event input parameter. This event object will contain the custom event's input parameters (example: event.param1, event.param2...), and the event object is automatically passed to the new action chain..
  3. In the action chain that will trigger the event, use the Fire Event action to trigger the custom event, providing any parameters defined for the event.

This table describes the parameters for the Fire Event action:

Parameter Name Description
event Name of custom event, defined in your application, that you want to invoke.
payload Event's payload; source can be a page variable, a specific value or an expression.

Here's an example of a call to the Fire Event action:

const fireApplicationEventNavigateToItemResult = await Actions.fireEvent(context, {
    event: 'application:customEventToFire,
    payload: {
       item: $application.variables.varForCustomEvent,
    },
});