cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
GaganMehrok
Helper I
Helper I

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
v-xida-msft
Community Support
Community Support

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

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.

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?

v-xida-msft
Community Support
Community Support

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
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Top Solution Authors
Users online (2,096)