Feature Request - Function to Select Values by Key From Array of Dictionary

Skip to first unread message

Drew Chapin

Jul 31, 2018, 11:45:10 PM7/31/18
to automa...@googlegroups.com
Maybe there's already an easy way to do this and I just couldn't figure it out, but I would like a function that takes two values, an array of dictionaries, and a key name. The function would return a 1 dimensional array of each value of the given key name from each dictionary in the array.

For example:


would return


using key name of age would give


Henrik "The Developer" Lindqvist

Aug 1, 2018, 2:49:27 PM8/1/18
to Automate
There's no built-in function for such specific use case. I'll likely implement lambda/function type so users can make custom filtering.
Until then use a For each, Expression true and Array add block to build result yourself.

Drew Chapin

Aug 4, 2018, 4:05:48 PM8/4/18
to automa...@googlegroups.com
I figured out a way to do this using jsonEncode() and findAll()...

Set Variable

Select names


Note: Makes the assumption that none of the name values contain a quotation mark.

Select ages


Note: The returned items are of type text, not number.
Reply all
Reply to author
0 new messages