JSON functions
json
Convert an object to json
Convert an object to is JSON representation
handlebars
{{json output['task-id']}}
Example, if the current context is :
json
{
"outputs": {
"task1": {
"value": 1,
"text": "awesome1"
},
"task2": {
"value": 2,
"text": "awesome2"
}
}
}
the output of {{ json outputs.task2}}
will be {"value":2,"text":"awesome2"}
.
jq
Transform vars with JQ
Apply the JQ expression to a variables.
handlebars
{{jq vars jqExpr [first=false]}}
first
mean to always fetch the first element, by default jq return an array of results
Internally, Jackson JQ is used and support only a large subset of official JQ.
Example, if the current context is :
json
{
"outputs": {
"task1": {
"value": 1,
"text": "awesome1"
},
"task2": {
"value": 2,
"text": "awesome2"
}
}
}
handlebars
{{jq outputs .task1.value true}}
the output will be 1
.