A couple of ways to make an array of values from a collection

A couple of questions have been asked about this so here is two ways to achieve getting values from a collection into an array:

There are always ‘multiple ways to skin a cat’ as the saying goes however i personally think the easiest in most cases is:

  1. Build your collection (Search for the records)
  2. create an empty array
  3. Loop through your collection
  4. push the item you want into your variable
  5. Just shows the finished array

An alternative way is:

const newarray = jsonata(`fields.$[external_id="copy_of_projectid"].values.value`).evaluate(record_collection_projects_31450);
3 Likes

This is very useful for advanced automation. Thanks for sharing, Jason.

1 Like

Great job @Jason
Thanks for sharing!!!

1 Like