Hi, @jNelly, I'll give you some non-loop actions to prep your data, then 3 actions in a loop to send it. You do not have to follow this EXACTLY ... have some fun with it ... you might find even better ways to do it. :-)
Iterate Over The Emails Instead
So, effectively, I am just shifting things around, you will work from a list of unique email addresses, then filter on those.
SelectAssigneeEmailsArrCNST
The first step is to make a 'simple' array of emails, and in my example I have named it per the heading for this section.
Use the below to assist, here ... you should be able to paste the below 'From' in the field ... :-)
| From |
@{body('Get_items')?['value']}
|
This is the list of items |
| Map |
@{item()?['EmailAddy']}
|
My email field |
- From - If this value doesn't just paste in there, create an expression and paste it in the expression builder removing the "@{" at the start, and the "}" at the end
- Map - Obviously use whatever you are referencing for your email address and if you need more information on the 'text view' for the 'Map' field see the end of this post
ForEachUniqueEmail
Now, ensure that there is a 'For each' / 'Apply to each' action which iterates over each unique email from your list. I have named mine per the heading for this section.
To get unique values, use the union() function as below:
That will ensure that only unique email addresses are now referenced from the previous array of multiples.
Now you need to run three actions on each email address inside this ForEachUniqueEmail loop:
I think that it's all relatively straightforward, there, so I won't go into detail on that ... however, the 'value' in the 'FilterToThisUsersItemsArrCNST' action 'From' field is the same one that you placed in the previous Select action, and the left part of the condition needs to be the email field, where the right is the current item being iterated upon. :-)
Helpful Info
We do not have a 'hide' function anymore, so you can ignore everything below this, unless you'd like to refer to it for information based on the above. :-)
Text View![Anchor Anchor]()
In some 'JSON' fields in Power Automate and Logic Apps you can directly write the JSON, or generate it. This is done via the 'text' option for entry of whatever you're doing there.
In the above instructions I referenced this at least once, and notably in the first step for the 'Map' data. Here's what the button looks like, there:
Then, when it is depressed, you get the following:
You might have noticed that the above is (probably) just a 'string' field from the SharePoint list I picked ... so how is THAT working as a value where there should be JSON? Well ... the Select connector has a super power whereby it can create 'simple' arrays consisting of a single value for each entity/item in the array. So there is a very good chance that the outputs of this will be one of those simple arrays ... in my case ... this: