array()
1
node-set array([node-set nodes])
Copied!
wraps the nodes of the node set nodes in a <json array="">…</json> structure, so that they can be used as an array in a JSON Template.
if the nodes contain an attribute (e.g. a="b"), it will be converted to an element <value name="a">b</value>), so that key and value are easily accessible in the template.

Example

JSON:
1
{"users": [ {"name": "Alice"},{"name": "Bob"}]}
Copied!
Template-Action:
1
<template>
2
{ "names": {{ array(users//name) }} }
3
</template>
Copied!
Output:
1
{ "names": ["Alice","Bob"] }
Copied!
Last modified 2yr ago
Copy link
Contents
Example