How to run a REST API/Query for a grouping of items in the message, return as an array to map all the results together in a drop down.
Hey everyone, really over my head but happy to search and read such a great community...
Basically, success I did API query and boy is it long. Wanting too pull from the response into a dropdown select the options to build a second call to filter the results.
From my searching and reading, I believe I need to do a js query, and write a script to return all the "sourceName" from my query.
Is this post the right idea? How to run a REST API/Query for each item in an array and return all results together
Here are some screenshots of my query and the copy paste of my work...
const arr = retention_source.data.message //your array of things to iterate over
const query = retention_source.data.message // your query to trigger for each
const promises = arr.map((item) => {
return query.trigger({
additionalScope: {
sourceName: item
}
});
});
return Promise.all(promises)