Forum Discussion
Send a Mail When a Field in a SharePoint List has a value of Yes
kevinmckeown8 Hi. Hoping you can help. Like many, I'm struggling to find the answer. I am LOVING Flow (and starting to promote in my org), but at risk of giving up where it just gets a little too advanced and time consuming. I came across your response, which was one of the simplest (and closest to my issue) which I could find.
I think I am close, just missing something obvious (at least I hope I am!). I have got my flow working, I think the basics are all good. Custom email to be sent once a SharePoint list item is modified, condition is to only send it if a choice value in a certain column is set to "Complete" (default value of the column is "Not complete").
I add the list item, the column stays as "Not complete", email doesn't send. Perfect.
Couple of hours later, I modify the list item, the column still stays as "Not complete", email doesn't send. Perfect.
Next day, I edit the list item, change this certain column to "Complete", the email sends. Perfect.
Like I say, it's working. My issue is STOPPING the email being sent again as soon as only one email has been sent. Once the column is set to "Complete", it will never be set to "Not complete" again.
Because I would normally go in and out of the list item at various times, I need some way of stopping the email being sent if the value was already "Complete" before modifying the list item. Not sure if I need a loop of 1 or what (this is where I am struggling to find help)
How do I stop the email getting sent when I go in and modify something else unrelated in the list item. Every time I make a change somewhere else, the condition is still being met, so the email is being sent out every time the list item is modified.
Thanks in advance!
Dave
- LindseyLeighOct 07, 2019Copper ContributorI have used this approach but my problem is the update the hidden field action via FLOW is essentially a modification, so TWO emails are sent.
- Dave PalmerSep 03, 2019Brass Contributor
Rob Ellis Thanks Rob, and thanks especially for the quick response. I actually had this method reserved as a 'Plan B'. Glad to report it worked though, exactly as you suggested (I finished testing it literally seconds after you replied!). Took a while to setup (list has over 100 columns, so a lot of monotony deleting values out of the 'Update list item' part of the flow), so I was reluctant to jump straight to that method.
Still just have that niggly feeling that there must be a simpler way.
Ah well. If it ain't broke...
- kevinmckeown8Sep 03, 2019Steel ContributorI was going to suggest the same method that Rob Ellis did. I'm not sure of another way to accomplish it.
- Dave PalmerSep 03, 2019Brass Contributor
kevinmckeown8 Thanks Kevin (and thanks for providing the answers on this post in the first place). Now that I have these additional columns, purely used for the Flow to work, then my next task is figuring out how to hide them from view (...but that's another story for another day, another pertinent forum post I need to find).
- LindseyLeighOct 07, 2019Copper ContributorI have a FLOW that is running off a SharePoint list. Triggered by Created or Modified (key is modified action), Condition runs the workflow to 1) Send an email 2) Update a field on the same itemMy problem is that because of the update field step (a modification) the workflow is sending two emails.Does anyone have any suggestions on how to accomplish both steps in one workflow without also sending two emails
- Rob EllisOct 07, 2019Bronze ContributorI think my reply above to Dave would apply - https://techcommunity.microsoft.com/t5/PowerApps-Flow/Send-a-Mail-When-a-Field-in-a-SharePoint-List-has-a-value-of-Yes/m-p/834734/highlight/true#M2659
- LabDude09Dec 05, 2019Copper Contributor
Rob Ellis I realise this is an older thread, but I am just wondering exactly how to follow your instructions. I have completed everything as mentioned above but am probably to new to this to realise the steps needed.
Do I create a new column in my list called 'FlowHasRun'?
Is there a step in the Flow that actually sets the value of the column in the SharePoint list?
Any help would be great thanks
- Rob EllisDec 06, 2019Bronze ContributorYou're exactly right - you need a column in the list called 'FlowHasRun' (or whatever you want to call it) - then have a SharePoint 'update item' action in your Flow that sets the value.
- DarrenPlantJun 02, 2020Copper Contributor
Rob Ellis I added the 'FlowHasRun' column to my SharePoint list but when I come to add the action to update that column to 'Yes', I get warnings in Flow Checker 'Actions in this flow may result in an infinite trigger loop. Please ensure appropriate conditional checks to prevent this flow from triggering itself'.
I have the following working from you description: Triggered by Created or Modified (I change a SharePoint list field to 'Yes'), Condition runs the workflow to 'Send an email'. I wanted to then update the SharePoint list item in the column 'FlowHasRun' to 'Yes' to ensure the flow doesn't get in a loop.
- RobElliottJun 02, 2020Silver Contributor
DarrenPlant I recommend you add a trigger condition in the settings of the SharePoint When an item is created or modified trigger. That way the flow will only trigger if the FlowHasRun column is equal to No. In my SharePoint list the FlowHasRun column is a single line of text column which defaults to No and the Update item action in the flow changes it to Yes. Because it's a single line of text column the trigger condition has single quotes around the 'No'. If you are using a Choice column then you'd need to replace 'No' with false:
@equals(triggerBody()?['FlowHasRun'],'No')Rob
Los Gallardos
Microsoft Power Automate Community Super User- nssn123Dec 08, 2021Copper ContributorThank you all for the tips, I was able to set this up in Power Automate. Follow-up on this, is there a way to consolidate the emails get gets sent out when the field is changed?
For example, I have a user that will submit multiple requests, like up to 20. Once I've completed the task, I'll bulk change the line items in the Sharepoint List to Complete. With the flow created, I'm afraid that it will send an email for each of the request submitted. Is there a simple way to send just one email to the requestor that the line items are done instead of 20?
Thank you!
- AlexshoreNov 20, 2021Copper ContributorI know you suggested this years ago, but this idea is genius and has solved my problems! I wanted to send an email when an application had been approved but I couldn't get it to stop emailing every time that row was amended. This made it a piece of cake so thank you!
- RobElliottNov 21, 2021Silver Contributor
Alexshore those posts are all quite old and have been superceded by the newer when an item or a file is modified trigger with the get changes for an item or a file (properties only) action. This allows you to check whether a specific column has been changed since the previous version. Make sure versioning is turned on in your list.
Rob
Los Gallardos
Microsoft Power Automate Community Super User