cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SusanneR
New Member

sending an email by Recurrence for list items with values of choice field for each element

Hi all,

 

I've learned a lot by reading this forum, but now I am stuck.

 

I have a list with colums for mailadress, remember date (something like due date) and choice of modules.

 

My flow is looking for elements which have todays date in column "Erinnerung" to send an email to the mailadress in column "Mailadresse" with the values of the choice column "Module".

The flow is working, but it sends mails with the value from "Module" of all elements of the list and not only one for each element that has reached todays date in column "Erinnerung".

 

I want to send an email for each element, with the values of the field "Module" for this element.

Hope I explained well, my english is not the best.

 

SusanneR_0-1605691561203.png

SusanneR_1-1605691795300.png

SusanneR_2-1605691955255.png

 What am I doing wrong?

 

Thanks a lot for helping.

 

Regards, Susanne

 

1 ACCEPTED SOLUTION

Accepted Solutions
kdavis91
Continued Contributor
Continued Contributor

@SusanneR ,

 

Using a filter is good; that way your flow loops through fewer records.

 

However, your problem is still that you are putting ALL of the modules in the variable (through the loops) and then afterward sending the email. Every Mail address will receive ALL of the modules.

 

Because you are using the filter now, you do not need the condition to check for the date. However, you do need to put the "Send Email" Action Inside the loop "Auf alle anwenden" but below "Auf alle anwenden 2". You then need to set your variable to null so that it is emptied before the first loop iterates to the next item. In this way, the variable that you place in your email will only have the values that you want for that email address.

 

note in my example that instead of "Module" my column name is "EventID"

LoopAndSendEmail.png

I hope this helps!

 

thanks,
Kyle

 

 

View solution in original post

5 REPLIES 5
kdavis91
Continued Contributor
Continued Contributor

@SusanneR ,

 

In your first apply to each loop (with the nested second loop), you are going through EVERY item in the list and then EVERY value in the "Module" column and adding ALL the "Module" values to the variable. Because of this, regardless of which items have a date matching today, the email will contain every value of "Module" for all the items.

 

If you only want the variable to have the "Module" values for items in the list that meet the desired criteria, you should put the loop that goes through the module values inside of the condition where you evaluate the date to see if it matches today's date.

 

 

Let me know if you have any questions or need any further clarification.

 

thanks,

Kyle

Hi and sorry for this long wait for my answer.

 

Your comment brought me to another idea, I now filter the elements by the date of today in the action "get elements"

SusanneR_0-1606198910610.png

That works, but than the loops, which I am not able to avoid, still do what they do and sent emails to the mailadresses of each row, but with all the modules of all rows.

 

My goal is, if the date in "Erinnerung" is reached, the "Module" of this element should be sent by email to the address in "Mailadresse" and only the choosen "Module" in the element to the given mailaddress:

SusanneR_1-1606199508272.png

 

Do I need to use more variables, to fill the values of the colums in the variables and use them in the mail?

And if it is so, how can I use a variable as a string and make it increasing at the same time?

There must be a solution in a better way. ;o)

kdavis91
Continued Contributor
Continued Contributor

@SusanneR ,

 

Using a filter is good; that way your flow loops through fewer records.

 

However, your problem is still that you are putting ALL of the modules in the variable (through the loops) and then afterward sending the email. Every Mail address will receive ALL of the modules.

 

Because you are using the filter now, you do not need the condition to check for the date. However, you do need to put the "Send Email" Action Inside the loop "Auf alle anwenden" but below "Auf alle anwenden 2". You then need to set your variable to null so that it is emptied before the first loop iterates to the next item. In this way, the variable that you place in your email will only have the values that you want for that email address.

 

note in my example that instead of "Module" my column name is "EventID"

LoopAndSendEmail.png

I hope this helps!

 

thanks,
Kyle

 

 

View solution in original post

SusanneR
New Member

@kdavis91thanks a lot, that was the hint I needed.

 

I've put every step in the loop now, and that works exactly how I wanted. ;o)

kdavis91
Continued Contributor
Continued Contributor

@SusanneR ,

 

Fantastic! Good work!

 

Glad to help!

 

Kyle

Helpful resources

Announcements
MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MSFTBizAppsLaunchEvent

Experience what’s next for Power Virtual Agents

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Users online (4,263)