cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
smorley
Post Patron
Post Patron

Help with trigger conditions using OR

Hi everyone, Happy Friday!

I've been reading this post on Trigger Conditions: 

https://powerusers.microsoft.com/t5/Power-Automate-Community-Blog/Trigger-conditions-filling-the-inf...

 

I have a flow where I would like a trigger condition where it is one of 4 different triggers.  I have 4 fields in my SharePoint list that could update, so I have created 4 dummy fields that update when a change is made.

So I would like my trigger condition to be this:

if field 1 is not equal to dummy field 1

or

if field 2 is not equal to dummy field 2

or

if field 3 is not equal to dummy field 3

or

if field 4 is not equal to dummy field 4

 

The syntax is kicking me to the curb, and if anyone can lend a hand that would be great.

 

Here is my actual flow for clarity.

 

tutorunitmanagement.jpg

1 ACCEPTED SOLUTION

Accepted Solutions
Expiscornovus
Super User
Super User

Hi @smorley,

 

You should be able to use this syntax. Replace the hard coded values 1,2,3 and 4 by your dummy fields.

 

@or(not(equals(triggerOutputs()?['body/field1'], 1)))
@or(not(equals(triggerOutputs()?['body/field2'], 2)))
@or(not(equals(triggerOutputs()?['body/field3'], 3)))
@or(not(equals(triggerOutputs()?['body/field4'], 4)))

 

triggerconditions_or.png

View solution in original post

4 REPLIES 4
Expiscornovus
Super User
Super User

Hi @smorley,

 

You should be able to use this syntax. Replace the hard coded values 1,2,3 and 4 by your dummy fields.

 

@or(not(equals(triggerOutputs()?['body/field1'], 1)))
@or(not(equals(triggerOutputs()?['body/field2'], 2)))
@or(not(equals(triggerOutputs()?['body/field3'], 3)))
@or(not(equals(triggerOutputs()?['body/field4'], 4)))

 

triggerconditions_or.png

Thanks @Expiscornovus - I was trying too hard with the syntax, trying to get it on one line.  Although I may have not explained it right.

Let me try again.
Looking at my flow.
Trigger the flow:

if Unit name doesn't equal workflow unit name or Med Year doesn't equal workflow med year 

I would like it to evaluate both at the same time.

@Expiscornovus syntax is good now, but the flow still runs twice.  Once when I make the change and it goes through the workflow and updates my list item, and then the second time where there were no changes.

Expiscornovus
Super User
Super User

Hi @smorley 

 

A possible workaround could be to add a boolean field (with a default value of false) to your list which. Set that boolean to true when your change the item for the first time in your flow. And add a boolean equals false expression to your trigger conditions. That could prevent your flow from triggering twice.

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.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (4,829)