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

Output of filter array Listed in a Single Email

Hi Experts,

 

Please check the flow below, I need to send an email to Task Assignee that The task of below projects are updated in last 24 hrs. In which I need to list out all the Project ID. The below flow I have written is running successfully, but the Task Assignee is getting multiple no of emails. 

 

My requirement here is in a single email, the assignee should receive that tasks of the following Projects are updated. 

Please help me in this. 

Prajnya_0-1630374101885.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
eliotcole
Super User
Super User

Hi, @Prajnya, does the list have the emails of the various people that you need to email about it?

 

If so, then I think you can simplify your loop down to just one stage.

 

Run a Select action on the data, and map a key called email to the email column. (I added one for the name, so I could address them personally)

 

Then make an Apply to each action that runs on on a union() of that select, twice. So that's:

union(body('Select'), body('Select'))

... that just sifts out all of the same entries.

 

Then for the first action in the Apply to each make a Filter action on the original input where one of the sides is the email field from that and other is:

items('Apply_to_each')?['email'] .

Obviously it only works if you have an email field in the list that has the person responsible for the item.

 

simplified emailing.jpg

 

If this isn't a solution, hopefully it just puts you on the way. 🙂

View solution in original post

2 REPLIES 2
rrovira
Microsoft
Microsoft

Hello, @Prajnya!

 

You could create a variable that store all the information and also have a variable that works as a loop breaker, once it's out of a certain loop you could send the email with the variable, that way it will only send an email per array and not a email per item. 

 

Though, I haven't tested this, but let me know if it gives you an idea! 

 

In the meantime I'll be working to replicate this and see if it works! 

 

Cheers,

Rodrigo

eliotcole
Super User
Super User

Hi, @Prajnya, does the list have the emails of the various people that you need to email about it?

 

If so, then I think you can simplify your loop down to just one stage.

 

Run a Select action on the data, and map a key called email to the email column. (I added one for the name, so I could address them personally)

 

Then make an Apply to each action that runs on on a union() of that select, twice. So that's:

union(body('Select'), body('Select'))

... that just sifts out all of the same entries.

 

Then for the first action in the Apply to each make a Filter action on the original input where one of the sides is the email field from that and other is:

items('Apply_to_each')?['email'] .

Obviously it only works if you have an email field in the list that has the person responsible for the item.

 

simplified emailing.jpg

 

If this isn't a solution, hopefully it just puts you on the way. 🙂

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (1,722)