cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
WorkHard
Super User
Super User

Trick to only send an email once when the workflow of the automation would send multiple

I have a flow that decides which user needs to be notified based on two Comboboxes plus one permanent user that's always notified, no matter the selection.
The flow is used in a Power App connected to a SharePoint list.

So for example:


First Combobox: (hard coded in the flow, always the same person)
If the weather is Sunny > Notify Person 1 

If the weather is Cloudy > Notify Person 2

Second Combobox: (hard coded in the flow, always the same person)
If the Region is USA > Notify Person 3
If the Region is not USA > Notify Person 4

Finally, always notify whoever is entered in a Person field. (Could be a different person or Person 1-4).

My flow looks like this:

WorkHard_0-1625756269736.png


What's the best way to prevent sending a duplicate email if the person that always needs to be notified is already one of the Person 1-4?

 

P.S: My real-world scenario is much more complicated than this. This is a simple example to illustrate the question I have.

1 ACCEPTED SOLUTION

Accepted Solutions
iAm_ManCat
Super User
Super User

Hi!

 

I would append the email addresses of the people to a string variable, that way you can use a condition block to check for if ThisPersonsEmail exists in StringVariableName, if yes then do nothing, if no then append their email to the string, then use that string variable in the To field when sending the email.

 

Cheers,

Sancho

@iAm_ManCat


Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


View solution in original post

2 REPLIES 2
iAm_ManCat
Super User
Super User

Hi!

 

I would append the email addresses of the people to a string variable, that way you can use a condition block to check for if ThisPersonsEmail exists in StringVariableName, if yes then do nothing, if no then append their email to the string, then use that string variable in the To field when sending the email.

 

Cheers,

Sancho

@iAm_ManCat


Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


Thanks. Except I wouldn't use the string in the To field because the outcome of each switch condition decides which person is notified.

So I have to collect the email addresses of everyone and then at the end check the string if the person at the end exists in the string or not.

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (3,350)