cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
acotarelo
Regular Visitor

Trying to get my flow to send an email to a specific recipient depending on what region is selected in a form.

Hi Everyone, please forgive what may sound like a simple task. Relatively new to flow building. I have a form set up with one of the questions asking for region. We have a representative in each region awaiting these form responses. My end game is:

  • Form is submitted
  • List in SharePoint is updated
  • Email is sent to the recipient depending on the region

I have the Form and SharePoint list updating correctly, however when I try to create a condition or a switch to determine the region and send accordingly, it saves, but sends multiple duplicate emails to every recipient regardless of the region selected. 

This is my flow:

acotarelo_0-1623249576052.png

 

 

That's working until I get here

acotarelo_1-1623194178477.png

 

The flow runs successfully but everyone gets an email multiple times regardless of the region when the form is submitted.

 

Can you help guide this newbie with your capable minds? 

1 ACCEPTED SOLUTION

Accepted Solutions
Campbell22
Helper I
Helper I

Hey @acotarelo,

A couple of issues with your flow, you do not need the Get Items action as you can use the Create Item action and get the necessary information for your flow from the action. Additionally, when using the Get Items action to only get one (or specific) records you need to use a filter query. This will allow the flow to know exactly which item you want rather than getting all items in your SharePoint list and preforming an action for all. A filter query looks like; 

2021-06-09 12_36_24-Edit your flow _ Power Automate.png

Where your desired column is specified and then eq and in single quotes (for string) your items value for that column (e.g. if your items Title is Test than filter Title eq 'Test' to get that specific item).

 

 

Regardless, for your flow you only need the Create Item action and a switch which will filter your regions choice column to a specific value and complete an action based on that value. In your SharePoint list I am guessing the region column is a choice column with choice options such as; N/A, UK and USA. Therefore, on the switch action, add the Region column to the Switch's "ON" area and add the desired column. If it is a choice column you will need to add the columns value, e.g. my column is Region since it is a choice column I need to select the Region value option from dynamic content as this will get the choice options not just the choice column (the choice options are your N/A, UK and USA values). Next add all the choice options from your column in the equals section of the case. Allowing the flow to filter the Region's value such as; N/A, UK and USA and depending on which value is select the subsequent case will trigger.

 

2021-06-09 12_38_28-Edit your flow _ Power Automate.png

2021-06-09 12_39_08-Edit your flow _ Power Automate.png

 

 

For example if the N/A option is selected I may want to send two emails, one to me and one to my boss to inform him that no region is selected for that item. The flow is case sensitive so it will only run subsequent actions that are associated to the case that was triggered.

 

Campbell

 

 

_____________________________________________________________________________________________________________________
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

 

View solution in original post

4 REPLIES 4
swathirajan
Helper II
Helper II

Hi,

 

I think, it is generating multiple emails as it was inside the loop.

Did you try to initialise and append the region as variable such as VarRegion?

 

Check the condition against VarRegion instead of actual region parameter.

This will not create loop and execute the condition only once.

 

-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

 

Gristy
Resident Rockstar
Resident Rockstar

Why are you using Get Items?

 

Use a switch control - and with the input use "Select your region" from the MS Forms input.

Campbell22
Helper I
Helper I

Hey @acotarelo,

A couple of issues with your flow, you do not need the Get Items action as you can use the Create Item action and get the necessary information for your flow from the action. Additionally, when using the Get Items action to only get one (or specific) records you need to use a filter query. This will allow the flow to know exactly which item you want rather than getting all items in your SharePoint list and preforming an action for all. A filter query looks like; 

2021-06-09 12_36_24-Edit your flow _ Power Automate.png

Where your desired column is specified and then eq and in single quotes (for string) your items value for that column (e.g. if your items Title is Test than filter Title eq 'Test' to get that specific item).

 

 

Regardless, for your flow you only need the Create Item action and a switch which will filter your regions choice column to a specific value and complete an action based on that value. In your SharePoint list I am guessing the region column is a choice column with choice options such as; N/A, UK and USA. Therefore, on the switch action, add the Region column to the Switch's "ON" area and add the desired column. If it is a choice column you will need to add the columns value, e.g. my column is Region since it is a choice column I need to select the Region value option from dynamic content as this will get the choice options not just the choice column (the choice options are your N/A, UK and USA values). Next add all the choice options from your column in the equals section of the case. Allowing the flow to filter the Region's value such as; N/A, UK and USA and depending on which value is select the subsequent case will trigger.

 

2021-06-09 12_38_28-Edit your flow _ Power Automate.png

2021-06-09 12_39_08-Edit your flow _ Power Automate.png

 

 

For example if the N/A option is selected I may want to send two emails, one to me and one to my boss to inform him that no region is selected for that item. The flow is case sensitive so it will only run subsequent actions that are associated to the case that was triggered.

 

Campbell

 

 

_____________________________________________________________________________________________________________________
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

 

Thanks for this breakdown and your patience with me.  This worked!

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.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (4,870)