array variable
AnsweredI want to run a CAML query, get all unique values for a field, then make an array of these, looping through each unique value and running another get items query.
So far, I've made a variable, then with each item from the query I've checked if it is included in the variable already using .includes(), if not, it is added.
The list grows, but how do I then use this list of unique values as an array to loop through and do other stuff?
Or is there an easier way to do all of this?
-
Hi Andrew
You're on the right track I think.
As soon you have the unique values in an array like this (hardcoded in this sample):
You can loop on these with the Loop action:
Configure another Get items action to query the list with the current unique value from loop as filter:
[[@Actions.Loop_apply_to_each.CurrentItem]]
Returns for loops first iteration: "Active"
The result of this Get items action can be use for another loop or send an email with the the returned items in an HTML table or like in my example Show message with all titles of the items.
Config:[[@Actions.Loop_apply_to_each.CurrentItem]]:
[[=[[@Actions.Get_items.Items]].map(act => act.Title).join(', ')]]
Result:0 -
That's super helpful thank you! The main problem was that I hadn't realised the format that the array variable had to be in: ["example1","example2"]
1
Please sign in to leave a comment.
Comments
2 comments