cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
GaganMehrok
Level: Powered On

Query: Using OR Logical Function

Hi All, 

 

I am trying to build a condition to check two values from the input and pass only the one which matches as per the conidtion. I am using OR logical function as both values can be true. 

 

My input is: 

 

[{"@odata.etag":"","ItemInternalId":"71623d16-e054-4eef-856d-fa4b6f2402df","Task_current_state":"Build","Task_current_substate":"Cancelled","Task_approval_status":"Not Yet Requested"}

 

My OR statement is as 

 

@equals(item()?['Task_current_state'], or(equals(item()?['Task_current_state'], 'Build'), equals(item()?['Task_current_state'], 'Peer Review')))

 

Though my output is empty. Its not giving me any error though i am not getting match from the expression. Can any one help please. Thanks. 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support Team
Community Support Team

Re: Query: Using OR Logical Function

Hi @GaganMehrok,

 

Could you please share a screenshot of your flow's configuration?

Do you want to filter data using OR Logical function within your flow?

 

I think there is something wrong with the formula that you provided, I have made a test on my side and please take a try with the following workaround:28.JPG

 

29.JPG

Within "Filter array" action, From set to output of "Get rows" action, click "Edit in advanced mode", type the following formula:

@or(equals(item()?['Task_current_state'], 'Build'),equals(triggerBody()?['Task_current_state'], 'Peer Review'))

Within "Send an email" action, type Output dynamic content of "Create HTML table" action within Body field, Is HTML set to Yes.

 

The flow works successfully as below:30.JPG

 

31.JPG

 

 

Best regards,

Kris

Community Support Team _ Kris Dai
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
Super User
Super User

Re: Query: Using OR Logical Function

Why wouldn't you just create a switch? returning the value when your status is set to Build or Peer review?

 

Alternatively a condition when your left side of the condition is set to true and the right side to 

or(equals(item()?['Task_current_state'], 'Build'), equals(item()?['Task_current_state'], 'Peer Review'))

 

Then in the yes branch set a variable to the status and in the no branch leave it blank.

GaganMehrok
Level: Powered On

Re: Query: Using OR Logical Function

I don't want to create switch account as i want to filter data and than create a html table out of the results. My current ask is to filter Build and Peer Review from set of data where state has other values as well. Thats why i am trying to put or logic and if any of these are true it should go to next step to form a html table and than to email. Would switch work in that as well?

Highlighted
Community Support Team
Community Support Team

Re: Query: Using OR Logical Function

Hi @GaganMehrok,

 

Could you please share a screenshot of your flow's configuration?

Do you want to filter data using OR Logical function within your flow?

 

I think there is something wrong with the formula that you provided, I have made a test on my side and please take a try with the following workaround:28.JPG

 

29.JPG

Within "Filter array" action, From set to output of "Get rows" action, click "Edit in advanced mode", type the following formula:

@or(equals(item()?['Task_current_state'], 'Build'),equals(triggerBody()?['Task_current_state'], 'Peer Review'))

Within "Send an email" action, type Output dynamic content of "Create HTML table" action within Body field, Is HTML set to Yes.

 

The flow works successfully as below:30.JPG

 

31.JPG

 

 

Best regards,

Kris

Community Support Team _ Kris Dai
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

Helpful resources

Announcements
firstImage

New Ranks and Rank Icons in April

Read the announcement for more information!

firstImage

Better Together Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (8,903)