cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Sending separate emails for unique values in SharePoint list

Hi everyone, I am trying to build a flow where I need to send recurrent emails depending on one specific column in the SP list. There is a column named "origin" and I need to send one email for unique values in that column. For example, if there are 6 items with 2 different origins, it should send 2 emails with origin in the subject and a table of all those items relevant to that unique origin. Below is my example, I cannot seem to figure out how to have the origin in the subject of the email.

 

1122334.jpg

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Anonymous 

 

Ah good. You’re using union and with the union being your input, the origin would be equal to dynamic value current item. 

but first, remove string from your first expression and then there is no need to split in the 2nd. To be honest you don’t need the variable for your splitting unique origins as the compose will do. Equally, you could just pass the union express to the input of your apply to each 2, but that’s just efficiency and saving on actions. Your solution will still work.

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Cheers,
Damien


P.S. take a look at my new blog here and like & subscribe to my YouTube Channel thanks 😉

View solution in original post

4 REPLIES 4
DamoBird365
Super User
Super User

Hi @Anonymous 

 

Would this origin be part of your apply to each 2 input array? Can you see it in the history of the splitting unique origins array? If you know the key name, you can build an expression for your subject item()?[‘Origin’].

 

but I am struggling to see where you define the unique origins. If you have an array of all 6, you can use union(array,array) and it will return the 2 unique values.

 

hope this is of help.

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Cheers,
Damien


P.S. take a look at my new blog here and like & subscribe to my YouTube Channel thanks 😉

Anonymous
Not applicable

Hi @DamoBird365 , thank you for your message. yes it is part of the apply to each 2 input array. Thank you for proposing the expression, I will try the expression and share update on this thread.
But so far I am able to get unique origins but finding problem in returning them in the subject of the email.
I am using this expression to make make them uniqueI am using this expression to make make them uniquethen I am splitting the unique origins from the compose outputthen I am splitting the unique origins from the compose outputAs you can see, the flow is sending two emails but in the subject I see the first unique origin as the compose outputAs you can see, the flow is sending two emails but in the subject I see the first unique origin as the compose outputand the second unique origin as the output as shown here. I wanted to see them with just the texts and not like an array codeand the second unique origin as the output as shown here. I wanted to see them with just the texts and not like an array code

Hi @Anonymous 

 

Ah good. You’re using union and with the union being your input, the origin would be equal to dynamic value current item. 

but first, remove string from your first expression and then there is no need to split in the 2nd. To be honest you don’t need the variable for your splitting unique origins as the compose will do. Equally, you could just pass the union express to the input of your apply to each 2, but that’s just efficiency and saving on actions. Your solution will still work.

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Cheers,
Damien


P.S. take a look at my new blog here and like & subscribe to my YouTube Channel thanks 😉

Anonymous
Not applicable

Thank you @DamoBird365 , it worked. It was simple and thank you for your help. Yes you are right, I could use with the union expression in the apply to each, but I used the variables because I find it easy to recall when I have to modify it in future 🙂
below is how it worked.

used union in compose and then used its output in the variableused union in compose and then used its output in the variableuse current item in the compose and used its output in the email subject lineuse current item in the compose and used its output in the email subject line

Helpful resources

Announcements
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.

PWREduCon768x460.png

Join us at PWR EduCon - A Power Platform Conference

Learn from the top Power BI, Power Apps, Power Automate & Power Virtual Agents experts!

Power automate tips 768x460 v2.png

Restore a Deleted Flow

Did you know that you could restore a deleted flow? Check out this helpful article.

Users online (3,212)