cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Filter a query by Yes/No column not working

Hi everyone,

 

Hope you are having a good day!

 

I am creating a flow that will get items from a sharepoint list with this filter on the query:

 

I've tried both,

ApprovalID eq <integervariable> and Cancelled eq 'true' 

 

@yashag2255 hope you can help.
@RobElliott 

and

 

ApprovalID eq <integervariable> and Cancelled eq true 

 

but neither seems to work since the query gets the item with the correct integer value but does not take into consideration the second query filter I've used, the 'Cancelled' column is a Yes/No Column in Sharepoint.

 

I'm patching the column "Approved" in Powerapps and after the patch, the do until of my flow stops even though there is no "Cancelled" eq true.

 

 

 

image2.PNGimage1.PNGimage3.PNG

 

1 ACCEPTED SOLUTION

Accepted Solutions
RobElliott
Super User
Super User

@Anonymous filter queries don't like Yes/No columns. You can put the ApprovalID in to the filter query but then you'll need a condition to check for Cancelled is equal to true.

Rob
Los Gallardos
If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.

View solution in original post

26 REPLIES 26
RobElliott
Super User
Super User

@Anonymous filter queries don't like Yes/No columns. You can put the ApprovalID in to the filter query but then you'll need a condition to check for Cancelled is equal to true.

Rob
Los Gallardos
If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.

Anonymous
Not applicable

I have successfull used a filter query in a Get Items action.  The column being tested for is: Details.  When I wanted to bring in items whose value of Details = No, my filter query is:  

Details eq 'false'

The key is the use of single quotes around either 'true' or 'false'

JoshuaGWilson
Advocate I
Advocate I

When its a Yes/No field you want to filter query it for when its true you use the not equal to operator "ne" and not "eq".

 

Example1: Cancelled ne false

 

Example2: ApprovalID eq <integervariable> and Cancelled ne false

 

Thanks, @JoshuaGWilson, this absolutely worked.

 

It's also absolutely crazy that the equality operator is broken. 😬

cyberjamus
Advocate I
Advocate I

"eq" is not broken 🙂

 

"Cancelled ne false" does not actually work, this filter statement will always evaluate as True, whether the column is set to Yes or No, as none of the Cancelled column values will have the value of "false"...

I.e. the Output will show Items where Cancelled is set to Yes and it will also show items where Cancelled is set to No.

 

Yes/No Columns must be evaluated as 1/0.

 

For your use case it would be:

Cancelled eq 1

 

Filtering with "Cancelled eq 1" will show all items with Cancelled column value set to Yes.

 

Test it out with a simple Test List with few rows before using it in Production.

i_power
Advocate II
Advocate II

agree with @cyberjamus - we have many yes/no columns and use queries like:

Column eq 1

 

Totally true, worked for me! Thanks

dhanal
Regular Visitor

This is driving me crazy.

When I set the column eq 1 it works perfect but not when column eq 0.

 

dhanal_1-1611267992366.png

dhanal_2-1611268058072.png

 

 

 

LostLogic
Frequent Visitor

This is an old topic, so, I'm sorry to dredge it up. But here is the reason:

If a document has not been tagged with NotifiedFinance = Yes, then the NotifiedFinance tag isn't set in the document metadata (If you download the data from Get Items (Properties) you'll see it's missing from all the documents where the tag has never been set.

 

Examples:

Doc1.docx has been set with NotifiedFinance to Yes -> Tag is added for NotifiedFinance to it's metadata with value 1.

Doc2.docx has not been set with NotifiedFinance to Yes -> No tag on the document or metadata.

Doc3.docx has been set with NotifiedFinance to Yes, but later was changed to No -> The NotifiedFinance tag exists in the Metadata of the document with a value of 0.

 

I'm not sure why SharePoint doesn't add "null" state values when tags are added, but that is the reason why it's not showing up when you try to set it to eq 0. Setting it to not equal, ne 1, will get all documents that are set to 0 (In theory)

 

Edit: Clarification of initial sentence

Anonymous
Not applicable

Please use 1 for true and 0 for false instead of Yes/No or True/False

E.g :- Cancelled eq 1

myvsparth
Frequent Visitor

I have faced this problem today and what I found if you have added "yes/no" column when you have already some records in the list  the old record will not be filtered as per your expectation, so for old records you need to manyally update yes no column for each record of write some automate to update it.

 

the condition would be like as below

myvsparth_0-1641961389046.png

 

Thanks,

like if it works for you 🙂

Sometimes (actually, mostly, it seems) M$ logic in creating these tools is astoundingly obtuse. I really think they must put a lot of effort into dreaming up ways to slow this tool down and frustrate its users. 

After 2 hours of experimentation and reading through posts on this site, this is what finally worked for me. My query ended up as this:

(MYOBimportgenerated eq 'No') and (Approved eq 1)

Both my columns MYOBimportgenerated and Approved are Yes/No columns. I tried creating a different column name for the Approved Column in case the word Approved was causing issues but that didn't work either. The only thing that worked for me is  No = 'No' and Yes = 1 

Far out M$ could you make it any more confusing???

Thanks @KarlinOz 

'No' and 1 works for me too.

Thank you  YesNoColumnName eq 1 for me finally worked!

Anonymous
Not applicable

@KarlinOz excellent, I would never have tried 1 and 'No', nor do I understand the logic behind it, but yes indeed, it works. 1 is true and 'No' is false...

DenisBoico
Frequent Visitor

For me I got it solved by using a combination of :
field eq 1  - for a true case
(field eq '' or field ne 1) - for a false case

Anonymous
Not applicable

Hi,

 

Use 1 for true and 0 for false

Cancelled eq 1

Boneckrh19
Kudo Kingpin
Kudo Kingpin

Answering in April of 2023, tested on a brand new flow made today. 

-No numbers ("Found operand types 'Edm.Boolean' and 'Edm.Int32' for operator kind 'Equal'")

-Nothing in single quotes ("Found operand types 'Edm.Boolean' and 'Edm.String' for operator kind 'Equal'")

-Nothing without single quotes ("Could not find a property named True", "Could not find a property named Yes")

 

Except for lowercase true/false:

yesnofield eq true
yesnofield eq false

Don't add true or false as an expression, just use as typed text. This is the only option that has worked for me today.

erikrs92
Regular Visitor

This Worked for me. OData Query :

For Get True/Yes values in column "Colum_True_false_name":

 

..... Colum_True_false_name eq 1

 

 

Helpful resources

Announcements

Celebrating the May Super User of the Month: Laurens Martens

  @LaurensM  is an exceptional contributor to the Power Platform Community. Super Users like Laurens inspire others through their example, encouragement, and active participation. We are excited to celebrated Laurens as our Super User of the Month for May 2024.   Consistent Engagement:  He consistently engages with the community by answering forum questions, sharing insights, and providing solutions. Laurens dedication helps other users find answers and overcome challenges.   Community Expertise: As a Super User, Laurens plays a crucial role in maintaining a knowledge sharing environment. Always ensuring a positive experience for everyone.   Leadership: He shares valuable insights on community growth, engagement, and future trends. Their contributions help shape the Power Platform Community.   Congratulations, Laurens Martens, for your outstanding work! Keep inspiring others and making a difference in the community!   Keep up the fantastic work!        

Check out the Copilot Studio Cookbook today!

We are excited to announce our new Copilot Cookbook Gallery in the Copilot Studio Community. We can't wait for you to share your expertise and your experience!    Join us for an amazing opportunity where you'll be one of the first to contribute to the Copilot Cookbook—your ultimate guide to mastering Microsoft Copilot. Whether you're seeking inspiration or grappling with a challenge while crafting apps, you probably already know that Copilot Cookbook is your reliable assistant, offering a wealth of tips and tricks at your fingertips--and we want you to add your expertise. What can you "cook" up?   Click this link to get started: https://aka.ms/CS_Copilot_Cookbook_Gallery   Don't miss out on this exclusive opportunity to be one of the first in the Community to share your app creation journey with Copilot. We'll be announcing a Cookbook Challenge very soon and want to make sure you one of the first "cooks" in the kitchen.   Don't miss your moment--start submitting in the Copilot Cookbook Gallery today!     Thank you,  Engagement Team

Announcing Power Apps Copilot Cookbook Gallery

We are excited to share that the all-new Copilot Cookbook Gallery for Power Apps is now available in the Power Apps Community, full of tips and tricks on how to best use Microsoft Copilot as you develop and create in Power Apps. The new Copilot Cookbook is your go-to resource when you need inspiration--or when you're stuck--and aren't sure how to best partner with Copilot while creating apps.   Whether you're looking for the best prompts or just want to know about responsible AI use, visit Copilot Cookbook for regular updates you can rely on--while also serving up some of your greatest tips and tricks for the Community. Check Out the new Copilot Cookbook for Power Apps today: Copilot Cookbook - Power Platform Community.  We can't wait to see what you "cook" up!    

Welcome to the Power Automate Community

You are now a part of a fast-growing vibrant group of peers and industry experts who are here to network, share knowledge, and even have a little fun.   Now that you are a member, you can enjoy the following resources:   Welcome to the Community   News & Announcements: The is your place to get all the latest news around community events and announcements. This is where we share with the community what is going on and how to participate.  Be sure to subscribe to this board and not miss an announcement.   Get Help with Power Automate Forums: If you're looking for support with any part of Power Automate, our forums are the place to go. From General Power Automate forums to Using Connectors, Building Flows and Using Flows.  You will find thousands of technical professionals, and Super Users with years of experience who are ready and eager to answer your questions. You now have the ability to post, reply and give "kudos" on the Power Automate community forums. Make sure you conduct a quick search before creating a new post because your question may have already been asked and answered. Galleries: The galleries are full of content and can assist you with information on creating a flow in our Webinars and Video Gallery, and the ability to share the flows you have created in the Power Automate Cookbook.  Stay connected with the Community Connections & How-To Videos from the Microsoft Community Team. Check out the awesome content being shared there today.   Power Automate Community Blog: Over the years, more than 700 Power Automate Community Blog articles have been written and published by our thriving community. Our community members have learned some excellent tips and have keen insights on the future of process automation. In the Power Automate Community Blog, you can read the latest Power Automate-related posts from our community blog authors around the world. Let us know if you'd like to become an author and contribute your own writing — everything Power Automate-related is welcome.   Community Support: Check out and learn more about Using the Community for tips & tricks. Let us know in the Community Feedback  board if you have any questions or comments about your community experience. Again, we are so excited to welcome you to the Microsoft Power Automate community family. Whether you are brand new to the world of process automation or you are a seasoned Power Automate veteran - our goal is to shape the community to be your 'go to' for support, networking, education, inspiration and encouragement as we enjoy this adventure together.     Power Automate Community Team

Hear what's next for the Power Up Program

Hear from Principal Program Manager, Dimpi Gandhi, to discover the latest enhancements to the Microsoft #PowerUpProgram, including a new accelerated video-based curriculum crafted with the expertise of Microsoft MVPs, Rory Neary and Charlie Phipps-Bennett. If you’d like to hear what’s coming next, click the link below to sign up today! https://aka.ms/PowerUp  

Tuesday Tip | How to Report Spam in Our Community

It's time for another TUESDAY TIPS, your weekly connection with the most insightful tips and tricks that empower both newcomers and veterans in the Power Platform Community! Every Tuesday, we bring you a curated selection of the finest advice, distilled from the resources and tools in the Community. Whether you’re a seasoned member or just getting started, Tuesday Tips are the perfect compass guiding you across the dynamic landscape of the Power Platform Community.   As our community family expands each week, we revisit our essential tools, tips, and tricks to ensure you’re well-versed in the community’s pulse. Keep an eye on the News & Announcements for your weekly Tuesday Tips—you never know what you may learn!   Today's Tip: How to Report Spam in Our Community We strive to maintain a professional and helpful community, and part of that effort involves keeping our platform free of spam. If you encounter a post that you believe is spam, please follow these steps to report it: Locate the Post: Find the post in question within the community.Kebab Menu: Click on the "Kebab" menu | 3 Dots, on the top right of the post.Report Inappropriate Content: Select "Report Inappropriate Content" from the menu.Submit Report: Fill out any necessary details on the form and submit your report.   Our community team will review the report and take appropriate action to ensure our community remains a valuable resource for everyone.   Thank you for helping us keep the community clean and useful!

Users online (4,217)