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:
- Build your collection (Search for the records)
- create an empty array
- Loop through your collection
push
the item you want into your variable- 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);