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

Trigger Condition Where Choice Field is Not Empty

I have a SharePoint library with a column called "StatesCertified".  It is a Choice field.  I am using a When a file is created or modified (properties only).  I want to create a Trigger Condition that so that the flow won't run if "StatesCertified" = "Select State(s)".  Here is what I have:

Trigger:  When a file is created or modified (properties only)

@not(equals(triggerOutputs()?['body/StatesCertified/Value'],'Choose State(s)'))

 

KathyRowland_0-1630269580203.png

 

I don't receive an error, but the flow runs even whe StatesCertified = Select States(s)

 

Can anyone provide some input?

Thanks!

Kathy

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @KathyRowland 

 

I’ve recently done a video on it. https://youtu.be/tlS6pSAx-GY The tip is to build the expression or as much as possible in a filter array action and copy it. I show you in the video.

 

@ekarim2020 as far as I know, you can construct the array path in a handful of ways, with or without ? And with a / as demonstrated in the original post. It results in the same outcome. Having a ? means that if the path doesn’t exist, null is returned instead of an error with the object not being found.


Give it a go and let me know.

 

Damien

View solution in original post

5 REPLIES 5
DamoBird365
Microsoft
Microsoft

Hi @KathyRowland 

 

If the expression triggerOutputs()?['body/StatesCertified/Value'] is somehow wrong, it will return null and so null will never equal Choose State(s) and so it will always return true. The other possibility is that equals is case sensitive, so you might want to wrap both expressions in equals in tolower or toupper.

 

To check your expression, drop the dynamic value into a compose and hover your mouse over it or click the elipses and peek at code. 

Hopefully it’s one of those two things.

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Cheers,
Damien


P.S. take a look at my new blog here and like & subscribe to my YouTube Channel thanks 😉

Hi @DamoBird365 !

 

Thanks so much for the feedback!  I'm still very new in building flows.  🙂  Originally, using the same SharePoint library, the same column (StatesCertified, a choice field), and the same flow trigger, I wanted to create a Trigger Condition that would run the flow only if StatesCertified was NOT blank (or empty...still not clear on which one I should use in this scenario).  Any chance you could you provide the expression I could use for that?  I've spent many hours looking for examples, but haven't found one that works for this scenario.

Kathy

ekarim2020
Super User
Super User

As @DamoBird365 pointed out, the expressions looks wrong. Can you try the expression in this format:

@not(equals(triggerOutputs()['body']['StatesCertified']['Value'],'Select State(s)'))

 Ellis

Hi @KathyRowland 

 

I’ve recently done a video on it. https://youtu.be/tlS6pSAx-GY The tip is to build the expression or as much as possible in a filter array action and copy it. I show you in the video.

 

@ekarim2020 as far as I know, you can construct the array path in a handful of ways, with or without ? And with a / as demonstrated in the original post. It results in the same outcome. Having a ? means that if the path doesn’t exist, null is returned instead of an error with the object not being found.


Give it a go and let me know.

 

Damien

KathyRowland
Frequent Visitor

@DamoBird365,

 

I can't thank you enough for your assistance on this!  As a result of watching your video https://youtu.be/tlS6pSAx-GY, I was able to successfully create the expression I needed!

 

@not(equals(triggerOutputs()?['body/StatesCertified'], ''))

 

  

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Users online (3,256)