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

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

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
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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Top Solution Authors
Top Kudoed Authors
Users online (12,788)