cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
darrendather
New Member

Trigger for a specific Status value in a list - works, but doesn't work

I'm new to this - hope i am posting to the correct area.

I created a simple PowerAutomate flow which sends and email notification under a certain condition.  I have a list of users that submit users suggestions.  Each row (each user suggestion) has 5 or 6 columns, including Requestor (email address) and Status.  My flow was set up to send an email notification to the Requestor, If his/her Status Value changed to a specific value.   So, the basic logic/rule is as shown below:

IF (Status Value) is changed to (specific Status Value), send email notification to (Requestor)...

I built 3 flows - one for each specific Status Value.  I tested it them and they worked great - I changed the value a few times and it only sent the email notification when the Status Value = one of my chosen values (i.e., "In Development" or "Need More Information" or "Scheduled for Development").  However, I also found out later that the flows will send email notifications when any column value in the other columns changes while my Status Value = (one of my specific values).  So, a user will get a notification when his/her Status value changes to In Development (which is correct behavior), and will also get a notification when any of the values in the other columns change while his/her Status Value is = In Development (this is not correct behavior). This seems to be a bug in the logic...not sure how to fix it...

7 REPLIES 7
grantjenkins
Community Champion
Community Champion

Are you using just major versions on your list (hopefully as makes it much easier), or minor versions too? Need to know this in order to build the flow how you want (only if the Status changes).

 

Also, you said you built three separate flows, one for each of the Statuses. Is that just because the email you send out is different depending on the Status, or some other reason? If so, then could quite easily build just the single flow and still get what you're after.



----------------------------------------------------------------------

If I've answered your question, please mark the post as Solved.

If you like my response, please consider giving it a Thumbs Up.

Hello, grantjenkins, and thanks for responding!  I don't know which version - it is a part of the MSF 365 Online for a branch of the Federal Government.  Is there an easy way to check I tried looking for "About" or "System" in Power Automate and in MSF 36 Online, but was not successful - I am not a technical user and somewhat clueless on many things).

 

Also, yes, I am building 3 simple flows because the email notification message to each status has a unique email message.

 

Does this help?

 

darrendather
New Member

Still needing help on this...

Working on it now. Just to confirm - is the Requestor column in the SharePoint List of type Single line of text, or is it a Person column?



----------------------------------------------------------------------

If I've answered your question, please mark the post as Solved.

If you like my response, please consider giving it a Thumbs Up.
grantjenkins
Community Champion
Community Champion

@darrendather I've got what I think you're after.

 

For this example, I'm using the following list. Note that the email (Requestor column) is stored in a Single line of text column. Note that it's important that you have set Major versions on the List.

grantjenkins_0-1670460140761.png

 

And for Status, I've setup the following choices, with the default value being Pending.

grantjenkins_1-1670460194268.png

 

Below is the full flow. I'll go into each of the actions.

grantjenkins_2-1670460241286.png

 

And the Switch cases.

grantjenkins_3-1670460265798.png

 

I've used When an item or a file is modified so it doesn't trigger the flow when the item is initially created - only when an existing item is modified.

grantjenkins_4-1670460439586.png

 

I've also set the trigger to run ONLY when the Status is one of the values you mentioned. To add a Trigger Condition, click on the three dots ... on the trigger, then select Settings.

grantjenkins_5-1670460514069.png

 

Then add a new Trigger Condition using the following expression, then click on Done.

@or(
    equals(triggerOutputs()?['body/Status/Value'], 'In Development'),
    equals(triggerOutputs()?['body/Status/Value'], 'Need More Information'),
    equals(triggerOutputs()?['body/Status/Value'], 'Scheduled for Development')
)

grantjenkins_6-1670460596903.png

 

Because we only want to do something when the item is initially set to one of the choices (not based on some other column change), we need to see if the Status column itself changed. To do this we can use Get changes for an item or file (properties only), passing in the previous version number. The expression used to get the previous version number is:

add(float(triggerOutputs()?['body/{VersionNumber}']), -1)

grantjenkins_7-1670460781318.png

 

Next, in our Condition, we can check to see if the Status has changed since the last version and the current version.

grantjenkins_8-1670460879165.png

 

If it hasn't changed, the flow will end. But if it has changed, we can continue to check what the Status Value is within the Yes branch.

 

In our Yes branch, we check to see what the value of Status Value is and have three Cases dependent on what the value is. If the Status Value is In Development, it will use the first Case. If the Status Value is Need More Information, it will use the second Case, etc. And within each Case we have a different email Subject and Body specifically for that Status.

grantjenkins_9-1670461151946.png

 

Hopefully this is what you're after. You'd need to change the SharePoint column names to suit exactly what you have in your List, but other than that everything else should just work.



----------------------------------------------------------------------

If I've answered your question, please mark the post as Solved.

If you like my response, please consider giving it a Thumbs Up.
darrendather
New Member

Grant, when you mention list version, is this the history versioning?

@darrendather Yes - I meant history versioning.



----------------------------------------------------------------------

If I've answered your question, please mark the post as Solved.

If you like my response, please consider giving it a Thumbs Up.

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,609)