cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
oaghaei
Resolver I
Resolver I

Solution brainstorming for flow with conditions

I've built a flow that sends users an email when their request was completed. The last step of the flow is a switch. On "Completed" it sends the user an email. 
completed switch.JPG

Sometimes, I go back into the SharePoint item and make changes to the project. Anytime I do that, it sends this email again because the status remains completed (the changes I make triggers the flow since it's a "when Item is created or modified" flow). Here is the beginning of my flow:
project completion flow.JPG

I would like for the flow to only send one email when the status was set to complete, but not every time I make a change. Is the only way to do that, to add an "update item" step to the end and have it change the status to something else (i.e. archived)? Or is there a more elegant solution? 🙂 

1 ACCEPTED SOLUTION

Accepted Solutions
abm
Super User
Super User

Hi @oaghaei 

 

Add another column in your SharePoint list called 'Send Email' Yes/No. Once the email is send then update the 'Send email' column to Yes. Also add an if condition after the trigger to check the status is complete and Send email is 'No' then send the email.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

View solution in original post

4 REPLIES 4
abm
Super User
Super User

Hi @oaghaei 

 

Add another column in your SharePoint list called 'Send Email' Yes/No. Once the email is send then update the 'Send email' column to Yes. Also add an if condition after the trigger to check the status is complete and Send email is 'No' then send the email.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

Thank you! That's a better solution than mine! 🙂 @abm

@abm I am re-reading your reply. I think I need a little more clarification. I added the Yes/No field to my SharePoint. However, I do not fully understand the modifications needed for the flow. Are you saying that instead of the switch I should create a condition for the status and the Yes/No field?

Hi @oaghaei 

 

Step 1: Add a new boolean column in SharePoint

Step 2: Flow Modifications

            (a) After send email, add a new step called update SharePoint list ad set the Boolean flag to Yes

            (b) Add a check in before the email whether the Boolean flag is No. Think you may need to remove the switch and add this as an if so that you can add your additional check whether the status is complete or not

                 If (Status == Completed && Boolean Flag == false) then

                         Send email

                         Update Boolean flag to yes

                 End If

 

Note: if you want you can keep the switch but you may need to maintain another If condition to check the Boolean flag is No before sending email. I would personally remove the switch and add all in one IF condition.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Users online (4,938)