cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
thegnic
Frequent Visitor

Send email when column value has changed

Hi, I am hitting a brick wall with this issue. Hopefully it is something simple that I have missed.

 

We have a list on SharePoint where one of the columns on the list is a simple yes/no choice. I want the flow to send an email to specifc people when this column is changed from no to yes.

 

I read some articles about triggers so I started playing about with that. Here is the flow (with the trigger below the flow - the trigger is applied to the 1st step in the flow):

 

flow 1.pngflow 2.png

 

 

 

 

 

 

 

 

 

 

 

 

The column name is 'processed by finance'.

 

The flow fails by timing out and suggests that the test action wasn't carried out so it doesn't really give me any errors. It does however send me an email (from me to me - even though I specified a different account to send from) and it shows the following:

 

flow 3.png

 

 

 

So it does kind of work but not in the way I want it to.....

 

Any suggestions appreciated.

 

Thanks

Gary

1 ACCEPTED SOLUTION

Accepted Solutions
efialttes
Super User
Super User

Hi!

I believe there are a couple of problems with the expression triggerbody()?['Processed by finance']

First, you are not using the column internal name (the one needed by flow), second your column is of type Yes/no... or a choice with two possible values (either Yes or No).

 

My suggestion is to replace the trigger condition logic temporarily and move it into a 'Condition' action block just after the trigger, so it will be easier for you to debug it.

Once removed, you need to figure out what your type of column is: either Yes/no or Choice with two possible values. If you are not familiar with SP config, you can figure it out by adding a dummy action block just after the trigger, assign as its input the Column... from dynamic content menu and if you hover your mouse over it, you will figure out its internal name. NExt add a Terminate action block. Reexecute the flow and inspect Compose's output. If 'Yes/No' I believe it is a multichoice, if 'true/false' I believe it is a Yes/No column.

 

NExt, you can replace 'Terminate' action block and add to your Condition action. O the left side of your Condition rule,assign the Column from Dynamic content menu. NExt select operator 'is equal to'. Now on the left side of the condition rule, if we are dealing with 'Yes/No' column add either the following WDL expression

true

...but if Choice column add the following text

Yes

 

So once you have the answer to these questions clear and test successfuly your flow, you can try again removing 'Condition' action block and adding 'trigger condition' instead. If so please take into account:

If the SPField is Yes/No type column, the trigger condition expression should be as below:

@@equals(triggerBody()?['InternalSPFieldName'],true)

If the SPField is choice type column, the trigger condition expression should be similar to:

@equals(triggerBody()?['InternalSPFieldNAme']?['Value'],'Yes')

 

Hope this helps

 



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



View solution in original post

4 REPLIES 4
efialttes
Super User
Super User

Hi!

I believe there are a couple of problems with the expression triggerbody()?['Processed by finance']

First, you are not using the column internal name (the one needed by flow), second your column is of type Yes/no... or a choice with two possible values (either Yes or No).

 

My suggestion is to replace the trigger condition logic temporarily and move it into a 'Condition' action block just after the trigger, so it will be easier for you to debug it.

Once removed, you need to figure out what your type of column is: either Yes/no or Choice with two possible values. If you are not familiar with SP config, you can figure it out by adding a dummy action block just after the trigger, assign as its input the Column... from dynamic content menu and if you hover your mouse over it, you will figure out its internal name. NExt add a Terminate action block. Reexecute the flow and inspect Compose's output. If 'Yes/No' I believe it is a multichoice, if 'true/false' I believe it is a Yes/No column.

 

NExt, you can replace 'Terminate' action block and add to your Condition action. O the left side of your Condition rule,assign the Column from Dynamic content menu. NExt select operator 'is equal to'. Now on the left side of the condition rule, if we are dealing with 'Yes/No' column add either the following WDL expression

true

...but if Choice column add the following text

Yes

 

So once you have the answer to these questions clear and test successfuly your flow, you can try again removing 'Condition' action block and adding 'trigger condition' instead. If so please take into account:

If the SPField is Yes/No type column, the trigger condition expression should be as below:

@@equals(triggerBody()?['InternalSPFieldName'],true)

If the SPField is choice type column, the trigger condition expression should be similar to:

@equals(triggerBody()?['InternalSPFieldNAme']?['Value'],'Yes')

 

Hope this helps

 



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Amazing! Worked a treat! Thank you so much! I've left the condition section in as I think this will be easier for me (and other users) to see what is going on.

 

I've now hit another stumbling block.....

 

I had another flow that emailed certain staff members depending on the values of columns - this worked ok. I now want to add this process into the yes condition. I've basically dragged and dropped this flow into the yes condition thinking that this would do the trick. I'm now seeing this error:

 

condition.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Basically, I've set it to email certain people when certain columns have certain values (departments basically). As mentioned earlier, this part works ok in it's own flow - I'm thinking that I'm missing something that needs pulled through from a previous step, could be wrong tho....

thegnic
Frequent Visitor

Don't worry about this, I think I've figured out what is wrong.

 

Thanks again!

@thegnic what did you do to figure it out.  I've created a similar Flow that will send email when an item is created to the first user, then once that user changes a field value it sends an email to the second user, then they make a field change and then it completes.  If you could share your flow steps, I'd greatly appreciate it, I'm stuck with mine, it's keeps doing infinite loops.

Helpful resources

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

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

Carousel_PP_768x460_Wave2 (1).png

2022 Release Wave 2 Plan

Power Platform release plan for the 2022 release wave 2 describes all new features releasing from October 2022 through March 2023.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (5,781)