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

Highlighted
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?

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.

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow Community User Group Member Badge

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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 264 members 4,266 guests
Please welcome our newest community members: