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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Sending an email based...
Power Automate
Answered

Sending an email based on Response of a form

(1) ShareShare
ReportReport
Posted on by 26
Good Afternoon,
 
I am trying to set up a flow that sends an email whenever a form is filled out.  The contents of the email and who it is going to and coming from is based on the response to the first question in the form.  I know how to set-up the flow to send the email, but want to make it so that I don't have to create separate forms for each of our stores.
 
It looks like I have the flowing flow, but think I am messing up the condition somehow.  I am attaching a photo of what the flow is currently set-up as with the condition.  Also, here is an example of the form I am trying to use, so you can see how there is multiple store numbers it could be.  https://forms.office.com/r/UUbUidtXjW
 
1. When a new response is submitted
2. Get responses Details
3. Condition - This is the part I think I am messing up...It should be marked as "True" if the answer to the first condition on the form is "13880".  If it is "False" it opens up a new condition based on the next stores number.
4. If "False" Move onto the next store number and repeat the previous steps
 
Thank you,
Anthony 
Categories:
I have the same question (0)
  • Verified answer
    Pstork1 Profile Picture
    68,717 Most Valuable Professional on at
    A better solution to this scenario would be to use a Switch instead of a Condition.  That way you can handle up to 26 different stores in the mainline of the switch. If you have more than that you can use a Switch in the default case to handle that many more.

    ----------------------------------------------------------------------------------
    If this Post helped you, please click "Does this answer your question" and give it a like to help others in the community find the answer too!

    Paul Papanek Stork, MVP
    Blog: https://www.dontpapanic.com/blog
     
  • tonster307 Profile Picture
    26 on at
    Would that mean it would go...
     
    When a new Response is submitted
    Get response details
    Switch - And the Parameters would be responses to "Store #" on the form
    And then it would be 12 cases and each case would have the "Equals" to the store number
    And then under each case you would add Send an email
     
    If so, then I think I got it!

     
  • Pstork1 Profile Picture
    68,717 Most Valuable Professional on at
    The equals is implied by the switch. In the switch you put the store # field and then in each case put one of the potential store numbers.  Then inside the case do the send email for that store. No Condition with equals is required.

    ----------------------------------------------------------------------------------
    If this Post helped you, please click "Does this answer your question" and give it a like to help others in the community find the answer too!

    Paul Papanek Stork, MVP
    Blog: https://www.dontpapanic.com/blog
     
  • tonster307 Profile Picture
    26 on at
    Thank you!  I think I got it, does it look correct on the attached?
     
     
  • Pstork1 Profile Picture
    68,717 Most Valuable Professional on at
    Yes that looks about right.  The one possible change would be to build the body of the email as a variable inside each case, but wait to send it until you exit the Switch. That way you only have to configure the email to send once. Either way works, it just depends which one is less work.   
    ----------------------------------------------------------------------------------
    If this Post helped you, please click "Does this answer your question" and give it a like to help others in the community find the answer too!

    Paul Papanek Stork, MVP
    Blog: https://www.dontpapanic.com/blog
     
  • creativeopinion Profile Picture
    10,502 Super User 2025 Season 2 on at
    @tonster307 I'd recommend using a Dynamic Reference Key instead of a Switch action. It'll be a lot easier to manage. 
     
    Are you using the Switch action in your flow? While it seems like a simple way to handle multiple conditions, it can quickly become inefficient and difficult to manage.
     
    Here’s why:
    ❌ You can’t use dynamic content in the Equals field.
    ❌ You have to manually recreate the same actions for each case.
    ❌ Any updates require you to edit every single case individually.
     
    This results in a flow that’s repetitive, hard to scale, and a nightmare to maintain.
    In this tutorial, I’ll show you how to replace redundant Switch actions with a **Dynamic Reference Key**—a simple but powerful way to streamline your flows. Instead of repeating the same actions over and over, you’ll create a **lookup-style structure** that makes your flows more efficient, scalable, and easier to update.
     
    IN THIS VIDEO:

    ✓ Why the Switch action is inefficient and what to use instead
    ✓ What is a Dynamic Reference Key
    ✓ Creating a custom look up in Power Automate
    ✓ Using a Dynamic Reference Key instead of writing an expression with nested if() functions
    ✓ How to use a Dynamic Reference Key to reduce actions in your flow
    ✓ How to use a Dynamic Reference Key to route emails to different recipients based on a MS Form Selection
    ✓ How to reduce redundancies in your flow by using a single Send an Email (V2) action instead of multiple instances
    ✓ How to use a Dynamic Reference Key to send email notifications 90, 60 and 30 days from today’s date

     

    Hope this helps!

    Consider giving me a ❤️ if you liked my response!

    👉 Level up your Power Automate skills by checking out my tutorials on YouTube
    👉 Tips and Tricks on TikTok and Instagram
  • tonster307 Profile Picture
    26 on at
    I keep having an issue where the flow is failing at the start of the switch. 
     
    Under "Ger Response Details" that is set to "Response ID" and then the Switch or "Stores" is set to the answer of the question "Store #s".  Then on each switch the equals is set to that specific store #.  When I change the "Store #s" in the initial switch to the "Response IDs" it works, but does not send the email like I am trying to do, assuming that is because none of the store #s match cause it isn't taking that answer.
     
    Sorry the longer I look at this the more confused I get with what I am doing!
  • Pstork1 Profile Picture
    68,717 Most Valuable Professional on at
    The switch is specific to data type. Make sure the answer to the question is either coming through as a number or that you are casting the value supplied to the Switch as a number.

    ----------------------------------------------------------------------------------
    If this Post helped you, please click "Does this answer your question" and give it a like to help others in the community find the answer too!

    Paul Papanek Stork, MVP
    Blog: https://www.dontpapanic.com/blog
     
  • tonster307 Profile Picture
    26 on at
    I'm so sorry!  I am still struggling with this.  I tried using copilot and it helped a little bit, but I can't get the flow to actually send the email.  I am attaching a few screen shots to see if maybe you can help me with whatever I am doing wrong. 
     
    Currently the issue I am having is that when the flow run it goes all the way through including the initial switch, but it does not trigger the actions underneath the original switch.
     
    - "Skipped Action" - This is showing when I run a test that it goes all the way through and then skips the 12 different actions after the initial switch.
    - "Switch Parameters" - This is just showing the the "Equals" inside of the switch is correct, I have verified that the questions in the form that it is pulling the data from and the flow are the same, just numbers.  And the question is multiple choice, so they have to give 1 of 12 answers so it should initiate the switch no matter what.
    - "Switch Code View" - This is just showing the switch code view, incase that is needed.  
     
    I have also verified that the Response ID matches the code in the actual form.  I feel like when you click the initial switch for the Parameters when I click the lightning bolt I should be selecting the "Store #" question under the "Get response details", but whenever I do that and test it, it fails.
     
    Thanks, and sorry to be constantly asking questions about this!
    Anthony
     
     
     
  • Pstork1 Profile Picture
    68,717 Most Valuable Professional on at
    I believe the problem is that your switch is checking the wrong value.  The value you have in your switch says it comes from the trigger.  But the answer to the question won't be in the trigger. That will only be in the dynamic content from the Get Response Details. So the switch doesn't fail because it gets a value, but the default case is the one that runs because the value supplied doesn't match any of your cases.

    ----------------------------------------------------------------------------------
    If this Post helped you, please click "Does this answer your question" and give it a like to help others in the community find the answer too!

    Paul Papanek Stork, MVP
    Blog: https://www.dontpapanic.com/blog
     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard