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

If condition in flow with multiple "or".

Hello Flowers,

 

I am trying to write an if condition that should be true if it means 1 of 15 different answers.

 

My research showed me that it should look something like this yet I am not sure that this is working! any help?

 

@or(equals(triggerBody()?['feature']?['attributes']?['inspector'], 'user1'), or(equals(triggerBody()?['feature']?['attributes']?['inspector'], 'user2'), or(equals(triggerBody()?['feature']?['attributes']?['inspector'], 'user3'))))

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Re: If condition in flow with multiple "or".

Hi @RamiAlouta,

 

I assume that you would like to combine multiple if conditions within one statement.

 

Please check the following code which will return corresponding value based on the input value:

if(equals(triggerBody()?['Title'],'test1'),'test1',if(equals(triggerBody()?['Title'],'test2'),'test2',if(equals(triggerBody()?['Title'],'test3'),'test3','test4')))

 1.PNG

Please take it for a reference and try it on your side.

 

Best regards,

Mabel

 

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Community Support
Community Support

Re: If condition in flow with multiple "or".

Hi @RamiAlouta,

 

I assume that you would like to combine multiple if conditions within one statement.

 

Please check the following code which will return corresponding value based on the input value:

if(equals(triggerBody()?['Title'],'test1'),'test1',if(equals(triggerBody()?['Title'],'test2'),'test2',if(equals(triggerBody()?['Title'],'test3'),'test3','test4')))

 1.PNG

Please take it for a reference and try it on your side.

 

Best regards,

Mabel

 

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
New Member

Re: If condition in flow with multiple "or".

Some small edits since I am using the survey123 connector!

 

It should look something like this:

 

@if(equals(triggerBody()?['feature']?['attributes']?['field_0'], 'user1'), true,if(equals(triggerBody()?['feature']?['attributes']?['field_0'], 'user2'), true, false))

Highlighted
Helper II
Helper II

Re: If condition in flow with multiple "or".

Hello, I was looking to do this as well, and went off the answer provided. I'm clearly doing something wrong because it is making a flow that worked fine without multiple criteria now crash.

 

I'm making an approval flow. What I'm trying to do is determine who the approval is sent to based on who requested it, as there are two individuals that go to one manager, everyone else goes to another.

 

The one that allows the flow to successfully run (but is missing Name 2 going to Manager 1 email) is:

if(equals(triggerBody()?['Author']?['DisplayName'], 'Name 1'), 'Manager 1 email', 'Manager 2 email')

 

So I tried to amend it based on the answer above to:

if(equals(triggerBody()?['Author']?['DisplayName'], 'Name 1'), 'Manager 1 email', if(equals(triggerBody()?['Author']?['DisplayName'], 'Name 2'), 'Manager 1 email', 'Manager 2 email'))

 

When making that one amendment the flow then fails. I haven't changed any other part of the flow, just that calculation. When I put it back to how it was previously it then works fine again.

 

Any insight would be greatly appreciated.

Helpful resources

Announcements
secondImage

August 2020 CYST Winners!

Check out the winners of the recent 'Can You Solve These?' community challenge!

thirdImage

Experience what's new for Power Automate

Join us for an in-depth look at the new Power Automate features and capabilities at the free Microsoft Business Applications Launch Event.

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Users online (4,596)