cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AAallday
Helper I
Helper I

Sending email to assigned user in item only

Hello,

 

I have a list that tracks annual on-site visits. Each visit is assigned to a couple of people. The intent of the flow I created was to send a reminder email each month to users who have a past due site visit or one due before the end of the following month (i.e. on the 26th of each month I look for pending site visits that have a due date in the next 37 days).

 

When the flow ran this month, it pulled the right list of facilities, but with each new facility it kept the email of the previous recipient(s), so buy the end it emailed all the reminder to anyone who was in the assigned to column within that set of facilities.

 

for example:

FacilityUser (and only people reminder should go to)Reminder Email actually went to 
A

1 & 2

1 & 2

B31, 2 & 3
C4 & 51 - 5

 

So what i need is that each email recipient is established new for each list item.

 

 

Here is my flow -- I am super-novice and tried to piece together from other questions in the forum -- thanks in advance!

 
 

Snag_22db2001.png

Snag_22db65c5.png

Snag_22dba3c8.png

 

@DAllen365 (you were a big help on my last question -- hoping you can do it again!)

1 ACCEPTED SOLUTION

Accepted Solutions
DAllen365
Resolver III
Resolver III

Hey @AAallday, thanks for the outreach!  After reading over your issue, it appears that your issue is that it is continuing to append to the variable and is never reset during each foreach.  What I think you should try is to add a set variable action at the top (or very bottom) of each foreach loop where you set the variable to the expression null().  This will erase the variable so it only holds the values for that list item and should solve your issue.  Let us know!


----------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

3 REPLIES 3
DAllen365
Resolver III
Resolver III

Hey @AAallday, thanks for the outreach!  After reading over your issue, it appears that your issue is that it is continuing to append to the variable and is never reset during each foreach.  What I think you should try is to add a set variable action at the top (or very bottom) of each foreach loop where you set the variable to the expression null().  This will erase the variable so it only holds the values for that list item and should solve your issue.  Let us know!


----------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Thanks again! 

Is this what you mean? 

AAallday_0-1615909984603.png

 

@AAallday Yes, I believe that should work.  I like to put it as the first action inside the foreach, but at the end should work too.  I actually just had to do again today to fix a looping issue.  Glad it was helpful!


----------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Super User 2 - 2022 Congratulations 768x460.png

Welcome Super Users

The Super User program for 2022- Season 2 has kicked off!

Users online (4,171)