cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Help with Trigger Conditions with SharePoint

Hi,

 

I have a trigger condition (shown below) to filter a SharePoint Item by Column 'Gate Review Status' is 'Complete'. I have this expression: @equals(triggerOutputs()?['body/Gate_x0020_Review_x0020_Status/value'], 'Complete').

 

I've also tried as 

@equals(triggerbody()?['body/Gate_x0020_Review_x0020_Status/value'], 'Complete'). 

 

I tried 

@equals(triggerBody()?['Gate_x0020_Review_Status']?['value'],'Complete'). Every time my test doesn't fail, but it just keeps running. If I take the 

 

chelclayne_0-1611339681581.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
Anonymous
Not applicable

this was the expression that ended up working...

 

@equals(triggerOutputs()?['body/GateReviewStatus/Value'],'Not Ready')

View solution in original post

6 REPLIES 6
Pstork1
Dual Super User
Dual Super User

Take a look at the incoming JSON when the trigger fires.  I've found that you can't do a trigger condition on a complex object like a choice column.  But if you look closely you will see a section of the incoming JSON similary to the one below.  This highlights a Status Choice column.  As you can see there is a Status#Id property.  This is the index of the selected choice.  Although you can't filter the trigger on the value of Status you can filter on this Id.

image.png



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Anonymous
Not applicable

chelclayne_0-1611343819516.png

 

I'm not having any luck with that, either.

 

Not the ID of the Status field.  There should be a property in the first level that is a simple integer called something like 'Status#Id' where Status is the name of the field.  The trigger query can't expand the complex object but it can access the first level simple properties.

image.png



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Anonymous
Not applicable

this was the expression that ended up working...

 

@equals(triggerOutputs()?['body/GateReviewStatus/Value'],'Not Ready')
jjohanes
Frequent Visitor

@Pstork1, I am trying to use a trigger condition to execute only when my Sharepoint List's Status column choice is changed to Completed.  I tried both trigger condition expressions in the "When an item is created or modified" action but only works when I have nothing specified in the trigger condition under settings of this action.   

 

I saw your first comment from 1/22/21 in this post, that trigger conditions do not work for choice columns.  Do you know if this is still the case?  I would like to only have this flow execute upon the Status field changing to Completed vs. anytime any column change in the list.  In my No condition I am using Terminate with the Cancelled output so I know when the Status column has/ has not been set to completed.         

 

@equals(triggerOutputs()?['body/Status/Value'],'Completed')

@not(equals(triggerOutputs()?['body/Status/Value'],'Completed'))

You can't do a trigger condition that will only pick up that the Status has been Changed.  The following will fire whenever the item is changed if the Status is "Completed"

@equals(triggerOutputs()?['body/Status/Value'], 'Completed')

To do what you want you then need to have something in the flow that fires that first time which records that the Status was changed to Completed.  Your Second Trigger condition would then be based on whether that value was still in its initial State.  If it isn't in that initial state then the modification isn't the first time the record was modified with Status Completed and the flow shouldn't trigger.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

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.

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 (1,643)