cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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

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

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

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))

Helper III
Helper III

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
PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (4,202)