web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Powerautomate automati...
Power Apps
Answered

Powerautomate automatic send email

(0) ShareShare
ReportReport
Posted on by 53

Hello! I want to send an email based on the selection in a column. How should I set up the flow in Power Automate to automatically send an email based on the person selected in the column?

Jonas9_0-1698135718427.png

Jonas9_1-1698135730480.png

Jonas9_2-1698135751137.png

 

 

 

Categories:
  • Verified answer
    AndrewR1 Profile Picture
    1,572 Moderator on at

    Hi @Jonas9 the issue you are facing in you are trying to compare multiple choices in a for each item which is one of these choices values. 

     

    To fix this its a bit of a data manipulation but ill walk you through how I achieved this: 

     

    So firstly the Choice column in SP when returned to PA will return as an array :

    AndrewR1_0-1698138853853.png

    So we want to initialise 2 variables at the top of your flow: 

    One Array and one String

    AndrewR1_1-1698138921470.png

     

    So what we need to do is in side your for each Value we want to append to the array variable: 

    AndrewR1_2-1698138977704.png

    The outputs of this are: 

    AndrewR1_3-1698139091273.png

    Then we want to convert this to a string that we can compare so we use:

    AndrewR1_7-1698139318684.png

    Outputs:

    AndrewR1_4-1698139124274.png

    Then we need to remove the ["Value1","Value2"] in to Value1, Value2:

    To do this we use compose and then this expression: 

    replace(replace(replace(variables('StringVar'),'["',''),'","',','),'"]','')

    This will then give us this output: 

    AndrewR1_5-1698139263378.png

    The we change the condition to be the following: this does not need to be in a for each loop:

     

    AndrewR1_8-1698139376356.png

     

    Hope this helps you 🙂 

    Please click Accept as solution if my post helped you solve your issue. ✔️ This will help others find the solution to this problem. It also closes the item. Remember, you can accept more than one post as a solution.

    If the content was useful in other ways, please consider giving it Thumbs Up. 👍

    Thanks
    Andrew

  • Jonas9 Profile Picture
    53 on at

    Thanks! How can i find this code?"So firstly the Choice column in SP when returned to PA will return as an array :" 

  • AndrewR1 Profile Picture
    1,572 Moderator on at

    @Jonas9 If you follow the steps i have done for you this will sort that out you just need to use the Choice Value in the for each loop see above for the steps.

     

    Thanks 

    Andrew 

  • Jonas9 Profile Picture
    53 on at

    Thanks! i have done it all, but it still says "False". I have also tried "Outputs"

    Jonas9_0-1698140660834.png

    Jonas9_1-1698140671215.png

     

     

  • Verified answer
    AndrewR1 Profile Picture
    1,572 Moderator on at

    Hi @Jonas9 that is because you have used Choice here not the outputs of the compose:  

    Yours:

    AndrewR1_0-1698140852293.png

    Mine: 

    AndrewR1_2-1698141023168.png

     

    It should be the output from the compose where we do the replace 🙂 

     

    Please click Accept as solution if my post helped you solve your issue. ✔️ This will help others find the solution to this problem. It also closes the item. Remember, you can accept more than one post as a solution.

    If the content was useful in other ways, please consider giving it Thumbs Up. 👍

    Thanks
    Andrew

  • Jonas9 Profile Picture
    53 on at

    Thank you! It works. Do you know if the flow can work regardless of the order in which the selections are made? For example, should both "test1, test" and "test, test1" be considered as true?

  • AndrewR1 Profile Picture
    1,572 Moderator on at

    @Jonas9 Awesome!! Can you accept my First response as the solution to this? It really helps me out!!

     

    Yes that would be an issue but if that is the case you would:

     

    Option one:

    want to structure the condition like so if you: 

    AndrewR1_1-1698141586860.png

    Option two:

    You could do a sort the choice in to an logical order and always compare off that? 

    To do this you would need to add a compose above the append to string variable and do this: 

    AndrewR1_2-1698141828800.png

     

     

    sort(variables('Choice'))

     

    This would then always put each choice in ascending order regardless of how it was selected. 

    My Input was:

     

    [
     "Horror",
     "Action"
    ]

     

    Output after sort: 

    AndrewR1_3-1698141911794.png

    Then our condition would look like this: 

    AndrewR1_0-1698142407309.png

     

     Please click Accept as solution if my post helped you solve your issue. ✔️ This will help others find the solution to this problem. It also closes the item. Remember, you can accept more than one post as a solution.

    If the content was useful in other ways, please consider giving it Thumbs Up. 👍

    Thanks
    Andrew

  • Jonas9 Profile Picture
    53 on at

    Thank you it works 😄

  • Jonas9 Profile Picture
    53 on at

    One last question. Is it possible to send a mail based on the selection. 

    If i choose test1@gmail.com and test2@gmail.com, then i will send a mail to them.

    Like this:

    Jonas9_0-1698145550730.png

     

  • AndrewR1 Profile Picture
    1,572 Moderator on at

    Hi @Jonas9 yes so if you are selecting Emails in the choice field then you can do the following:

     

    Where we have a , separating them we would want to replace this with a ; as this is what is needed for separating emails:  

    The replace expression should be changed to this: 

     

    replace(replace(replace(variables('StringVar'),'["',''),'","',';'),'"]','')

     

    This would then give you the following outputs which is what the outlook connector would be wanting: 

     

     test1@gmail.com;test2@gmail.com

     

    Hope this makes helps 🙂 

    Please click Accept as solution if my post helped you solve your issue. ✔️ This will help others find the solution to this problem. It also closes the item. Remember, you can accept more than one post as a solution.

     

    If the content was useful in other ways, please consider giving it Thumbs Up. 👍

     

    Thanks 

    Andrew

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 360 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 325

#3
Mohsin Ali Profile Picture

Mohsin Ali 232

Last 30 days Overall leaderboard