Extract dictionary columns
Using |column
You can extract the same column from a list of dictionaries with the |column
filter.
-
start: set: people: kina: name: Kina Halpue email: kina@cerb.example milo: name: Milo Dade email: milo@cerb.example return: emails: {{people|column('email')|join(', ')}}
-
__return: emails: kina@cerb.example, milo@cerb.example
Using |map
You can extract the same column from a list of dictionaries with the |map
filter.
-
start: set: people: kina: name: Kina Halpue email: kina@cerb.example milo: name: Milo Dade email: milo@cerb.example return: emails: {{people|map((v)=>v['email'])|join(', ')}}
-
__return: emails: kina@cerb.example, milo@cerb.example