It's important to know and understand how to use JMESPath expressions to unlock the full potential of LetsFlow. You can find more examples in the JMESPath documentation.
<tpl>
When a function receives a simple string, it is treated as a Mustache template, with the process itself serving as the data (also known as the Mustache view).
You can explicitly specify both the template and the view for more flexibility. This allows you to apply a JSON query using <ref> to filter or transform the data before rendering the template.
The select data function picks one of the options based on value.
The selection value is specified as $. The default value is specified with the * key. The other properties is used as map of option ⇒ value.
states:
(cancelled):
description: !select
$: !ref previous[-1].actor.key
client: Cancelled by the client
team: !tpl Could not be completed because {{reason}}
'*': Aborted
{
"states": {
"cancelled": {
"description": {
"<select>": {
"$": {
"<ref>": "previous[-1].actor.key"
},
"client": "Cancelled by the client",
"team": {
"<tpl>": "Could not be completed because {{reason}}"
},
"*": "Aborted"
}
}
}
}
}
The selection value must be a string, number, or boolean. For a boolean value use the keys true and false.
If no default value is specified, the selected value will be null if there's no match.