Send a Mail When a Field in a SharePoint List has a value of Yes

Brass Contributor

Hello

 

We have a SharePoint List that people can add to / edit etc...

 

We want to have a Flow that monitors this list and when a field changes to Yes we want a email sent to a person that basically says "ID 123" has changed

 

Any idea how this can be done?

24 Replies

At the moment flow that triggers when a specific SharePoint column is changed. A UserVoice request for it is at https://powerusers.microsoft.com/t5/Flow-Ideas/Trigger-flow-When-Item-is-Modified-only/idc-p/239328#...

 

Possibly the only thing you could do is to start with a recurrence schedule, perhaps to run once or twice a day, then add a Get items action from the SharePoint list, then add a condition that if the field you are interested in equals Yes then send an email, otherwise don't. So it won't happen as soon as the column in the SharePoint list is modified but it will trigger soon after.

Rob
Los Gallardos

oh ok thanks

 

Would you have details on how to setup the recurring schedule?

For the first item in the flow type recurrence into the box and select Recurrence Schedule. Set  the frequency - in my image below it's set to once a day but could be several hours or even after x minutes.

Then set your time zone and the time it needs to run. After that do your Get items action and the rest of the flow.

Rob
Los Gallardos

recurrence.jpg

Based on your original details, this sounds like a pretty straightforward Flow.

 

Here is how I understand your question and the result you are looking for:

1. An item in a SharePoint list is modified

2. If a specific field value is changed to "Yes", then send an email.

 

You can accomplish this with the following steps in Flow:

1. When an item is created or modified (set this up for your specific list)

2. Condition (check to see if your field is equal to "Yes")

3. If the condition is true/yes, then use the Send an Email action

4. If the condition is false/no (your field does not equal "Yes"), then do nothing.

 

This Flow will run every single time that an item is modified in your list. However, it will only send the email if your field value is equal to "Yes". 

 

If there are more nuances or requirements to the Flow scenario you are trying to create, please include them here. Otherwise, based on the initial ask, I believe this will suit your needs.

 

Capture.PNG

 

 

 

@Kevin McKeown 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

 

 

You could have the flow set the value of an extra column - e.g. set 'FlowHasRun' to 'True' - then check that value in the Flow, so the email is only sent if your column is 'Complete' AND 'FlowHasRun' column is 'false'

@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...

I was going to suggest the same method that Rob Ellis did. I'm not sure of another way to accomplish it.

@Kevin McKeown 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).

@Dave Palmer If you go into the List Settings, you can go down to Views, select the view to modify, then select which columns are shown in that view. 

 

Additionally, if you want to keep columns from showing in New/Edit Forms, then you need to:

  • Go to List Settings
  • Go to Advanced Settings
  • Set "Allow management of content types?" to Yes. Click OK.
  • On the List Settings page you should now see a "Content Types" section. Click the "Item" content type.
  • Click one of the columns you want to hide from forms.
  • Change the column setting to "Hidden (will not appear in forms)". Click OK.
  • Do this for all columns that you want hidden from forms.
  • Once done, go back to Advanced Settings and set the "Allow management of content types?" back to No.
    • If you leave content type management on, then your forms will always show a "Content Type" dropdown at the top of the form.

 

clipboard_image_1.png

Hi @Pn1995 

 

 

Microsoft Flow triggers now have a built-in condition checker (in the settings). You can set a condition for a specific column, so that the trigger only fires when the condition is met.

 

You can find more details here.

@Kevin McKeown Thanks Kevin.  I knew how to hide columns from a view, but didn't have a clue how to hide them from new forms (so that's REALLY helpful).

 

I was concerned about going 'off topic' here (don't like upsetting the forum Gods), but to be honest - you've made me think of a pertinent question/point.

 

Not sure what I was doing wrong, but it seems the only way I've eventually got these Flows working is by using the 'Limit Columns by View' setting, early on in the Flow (i.e. in the Trigger).  Could just be that I was fumbling at first, but all of my Flows have this in place.  It 'felt like' I simply had so many columns in my list (over 100) that I HAD to use this.

 

So I wasn't going to rush and hide these extra columns I've needed to add (just to get this one working) from the view.  Presumably, if I'm limiting columns by view (call it 'View A')...  then if I remove columns which I'm using in the Flow from View A, then it's not going to work.

I know, I know...  I need to test it.

 

Just thought that if you could shed any light on the 'Limit Columns by View' setting, it could help others finding this thread in future (and help me understand more too).  Feel free to point me to another post if there is one (I probably should have checked first).

 

I 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 item
 
My 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 Ellis 

I 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.

@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

You'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.

@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.

 

 

@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')

 

1-Flow.png

 

2-triggerCondition.png

 

Rob
Los Gallardos
Microsoft Power Automate Community Super User