Hi,
I have a flow that checks a SP list every day at 8 am.
If any item in the list has a Call Returned status set to No, it needs to send an email to all staff linked to that item.
The staff email column is a People Picker column.
Item 1 has two recipients, staff1@gmail.com, and staff2@gmail.com.
Item 2 has 1 recipient. staff3@gmail.com.
I need the flow to send an email to the corresponding recipients, for each item.
Unfortunately what's happening at the moment is it's combining them and sending out 2 emails with all 3 in each.
I believe this is to do with my Append to Array variable.
What is the best way to do this?
Hi Levi,
Sure thing. I did try your setting variable and clearing it with a null value but because of the concurrency of the Email with Options step it wasn't working.
We have a "Missed Call Log" SharePoint list that our administration staff fill in manually, including details such as:
On creation of a new list item, a Power Automate flow runs, sending out an "email with options" (If the option in the email is clicked, sets "Call Returned" field to Yes, preventing the second flow from running) to all staff in the "Phone Call For" field.
This step is working perfectly. No issues here.
The problem is with the second Power Automate flow i'm running.
This second flow is a Reminder email, triggered using a Recurrence, happening at 8 am every weekday.
Any item that still has "Call Returned" set to No, this flow is meant to send an "Email with Options" to all staff for each item, to return their missed call.
Separate email for each missed call item.
For example:
Missed call #1 has 3 staff members listed.
Missed call #2 has 1 staff member listed.
Missed call #3 has 2 staff members listed.
At 8 am this reminder flow needs to send out 3 emails.
The first email combines the 3 staff members emails from call 1 into a string, each separated by a semicolon ;
The second email doesn't need to combine, so it just sends it
The third email combines the 2 staff members emails from call 3 into a string, separated by a semicolon ;
How I currently have it set is:
Flow triggered at 8am on a weekday >
Get items (with Filter Query set to: Phonecallreturned eq 'No' ) >
Initialize Array Variable. This will be populated later to combine each staff members email (EmailArray) >
Apply to each item with Phone Call Returned = No > (NOTE: Concurrency is enabled)
| Apply to each staff member in the item (Phone call for) > (NOTE: Concurrency is enabled)
| Get user profile (gets their email) >
| Append to array variable (EmailArray) >
| Join array with ; >
| Send "Email with Options": The "To" field is the Join output >
| Switch step for the "Email with Options" response (SelectedOption).
| Update Item > Set Phone Call Returned to Yes
The issue i'm having is it's combining staff from multiple items.
In the first image below, for item "Test 4th input", it emailed 5 recipients.
But the SharePoint list only has 2, as shown in the 2nd image.
1st image
2nd image
I need the concurrency to send the email with options, otherwise they get stuck withing for a response from the first person before the second email goes out.
But the concurrency is causing it to join all of the reminder recipients together I think.
These are the 3 SP list items i'm testing with.
5 total recipients over 3 different items.
I don't know the best way to make this work.
Hopefully this makes sense.
Hi @tmaloney3
Sincere apologies for the late reply, I'm sorry I didn't understand your intention.
Could you explain the following to me again?
Thank you!
Best Regards,
Levi
Hi Levi,
Thanks for this solution! Testing it separately it works.
However, when I implement it into my flow it fails to do what I need.
I forgot to mention previously that I use an Email with Options step, that follows up with a Switch after the staff member selects the option, it flags the item as Call Returned = Yes.
I need to have concurrency turned on for the Apply to Each step otherwise it sends out 1 email, and doesn't send out anymore until the first person has clicked on the Option.
It's also doing the double up on recipients with this, which I assume the concurrency is causing this.
Anyway to tweak your solution to work with this?
Hi @tmaloney3
After appending the variable you need to empty the variable to avoid repeated emails.
You can create another variable to empty your array variable.
I have made a test for your reference(Here I use string variable):
Best Regards,
Levi
WarrenBelz
146,605
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,946
Most Valuable Professional