(key: string): any
(all: boolean): any
(arguments: {
all?: boolean,
key?: string,
default?: any
}): anyThe _event operator gets a value from the event object. The event object is a data object provided to an action by an event. This object is also available to a request or connection called by the Request action.
Arguments
string
If the _event operator is called with a string argument, the value of the key in the event object is returned. If the value is not found, null is returned. Dot notation and block list indexes are supported.
boolean
If the _event operator is called with boolean argument true, the entire event object is returned.
object
all: boolean: Ifallis set totrue, the entireeventobject is returned. One ofallorkeyare required.key: string: The value of the key in theeventobject is returned. If the value is not found,null, or the specified default value is returned. Dot notation and block list indexes are supported. One ofallorkeyare required.default: any: A value to return if thekeyis not found inevent. By default,nullis returned if a value is not found.
Examples
Get the value of my_key from event:
_event: my_key_event:
key: my_keyReturns: The value of my_key in event.
Get the entire event object:
_event: true_event:
all: trueReturns: The entire event object.
Dot notation:
Assuming args:
my_object:
subfield: 'Value'then:
_event: my_object.subfield_event:
key: my_object.subfieldReturns: "Value".
Return a default value if the value is not found:
_event:
key: might_not_exist
default: Default valueReturns: The value of might_not_exist, or "Default value".
Block list indices:
Assuming event:
my_array:
- value: 0
- value: 1
- value: 2then:
_event: my_array.$.valueReturns: 0 when used from the first block (0th index) in a list.
