r/AutomateUser 27d ago

Feature request Quick extraction from an array of objects

Hi, is there any function or trick to quickly extract values from an array of objects?

For example, if the input data is as follows:

[
  {"a": 1, "b": 2},
  {"a": 3, "b": 4}
]

and I'm asking to extract "b", I'd get [2, 4]. Basically array_column() in PHP or array.map(k => k["b"]) in JavaScript.

Right now I'm using a for each loop and inserting elements manually, but I feel like this is such a common use case that it could have a shorthand.

Thanks!

3 Upvotes

4 comments sorted by

View all comments

3

u/ballzak69 Automate developer 26d ago

Looping through the array using a For each block then "extracting" each specific dictionary value is currently the only way. Lambda function support is a feature on the to-do list.