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

oData filter issue with a boolean field

I'm trying to use oData filter on IsSaleProcessingStopped field in SalesOrderHeaderV2 and having a hard time making it run. 

This field is a NoYes enum and i'm trying to filter results where value is Yes. Tried writing it few different ways(eq '1', eq 1, eq true, eq 'true') but keep getting errors. Any suggestions?

 

An error has occurred. A binary operator with incompatible types was detected. Found operand types 'Edm.Boolean' and 'Microsoft.Dynamics.DataEntities.NoYes' for operator kind 'And'.

 

Screen Shot 2020-05-07 at 11.27.41 PM.png

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @raoraheel ,

 

Yes, you could only filter the Boolean field in the Filter Array action.

 

Best regards,

Alice   

Community Support Team _ Alice Zhang
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

9 REPLIES 9
Jcook
MVP

Hi @raoraheel 

 

Have you tried using a filter array action instead. Sometimes there is some limitations on the actions Odata queries.

 

If you want you can use the last filter on the Dynamics one and than use the filter array for the first filter you are trying to do.


Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips,
tricks, and guides
FlowAltDelete





v-alzhan-msft
Community Support
Community Support

Hi @raoraheel ,

 

We couldn't use odata filter on Yes/No type column currently, as is mentioned in the post below:

https://powerusers.microsoft.com/t5/Building-Flows/Filter-a-query-by-Yes-No-column-not-working/td-p/...

 

And you could yse the Filter Array to achieve the requirement:

1.png

 

Best regards,

Alice   

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-alzhan-msft please correct me if i'm wrong. Wouldn't that mean that first I will get unfiltered orders and then the filter array will do my filtering? I was hoping to start with first set of filtered orders and then use filter array to drill further down with some conditions. Let me know please. Thanks

Hi @raoraheel ,

 

Yes, you could only filter the Boolean field in the Filter Array action.

 

Best regards,

Alice   

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Tacsi
Advocate I
Advocate I

You can use IsSaleProcessingStopped ne 'false' the inverse seems to work. 

Thanks! This seems to do the trick.

MaxBarrass
Frequent Visitor

So that we have the right solution for this, you need to use 1 for true 0 for false.

 

so in your case it should be IsSaleProcessingStopped eq 1.

Thank you @Max -- using 1 or 0 seems to work for me too.  Only thing that did.

Which is so strange, since if you look at your Power Automate "Raw Output" for the sharepoint data grab, it says clearly "true" instead of "1".  


Oh, Microsoft.... 🙃

SecurityChris
New Member

You are able to crate an ODATA Filter Query for boolean (Yes/No) values. True (Yes) evaluates as '1', False (No) as '0'. In your case the syntax would be:

 

IsSalesProcessingStopped eq '1' and SalesOrderNumber eq '63723566'

 

I was trying to achieve something similar and couldn't accept it was impossible to filter on boolean values, or that multiple actions would be required to do so. I found what I was after on Power Automate SharePoint Get Items Filter Query + 12 Examples.

 

I have used and tested this syntax and the output was as required - only those entries that satisfied both conditions. I then created an HTML table to view the outputs:

 

GetItems Filter Example.png

Create HTML table example.png

Hope this helps almost tweo years later!

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Super User 2 - 2022 Congratulations 768x460.png

Welcome Super Users

The Super User program for 2022- Season 2 has kicked off!

Users online (2,577)