web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Compound filter, boole...
Power Apps
Unanswered

Compound filter, boolean field ignored

(0) ShareShare
ReportReport
Posted on by 704

In following example a filter is set on a cds table compounding 4 subfilters. The first "ExportDocaWW" is a Boolean field. The gallery showing the collection correctly shows the value of the field using If(ThisItem.ExportDocaWW;"J";"N") but both types "J" and "N" are visible while according to the filter only "J" should pop up. The other subfilters work as expected. What gives?


European style syntax, sorry

ClearCollect(
                    DRDierEvents
                    ;Filter(
                             DierEvent
                             ;(ExportDocaWW)
                              And (EventtypeId=3)
                              And (EventDatum >= ExportDatumBegin.SelectedDate)
                              And (EventDatum < DateAdd(ExportDatumEind.SelectedDate;1))
                           )
                )

I have the same question (0)
  • David Jennaway Profile Picture
    716 on at

    I think you have to explicitly specify the value to match against, as (ExportDocaWW) will be interpreted as matching any non-null value of ExportDocaWW. Instead, use an equality test, e.g. (ExportDocaWW=true) And (EventtypeId=3)

    If this doesn't work, try (ExportDocaWW=1)

     

  • HansHeintz Profile Picture
    704 on at

    Well I found out I I do the filtering in two steps doing three in the first step and the Boolean filter sperately but apart from that exactly the same and with the same data it WILL work. A bug I would say. (MyBoolField = true) does not compute btw, I get red decoration under the =  Also non-consequent

  • Verified answer
    v-xida-msft Profile Picture
    on at

    Hi @HansHeintz ,

    Could you please share a bit more about the "DierEvent" data source? Is it a CDS Entity?

    Could you please show more details about the "Boolean" field in your CDS Entity? Is it the "Two Options" type column?

     

    Firstly, there is no data type called "Boolean" in CDS Entity currently. I suppose that the "Boolean" field that you mentioned is actually the "Two Options" type column, is it true?

     

    If the "ExportDocaWW" field is a "Two Options" type column in your "DierEvent" Entity, I think there is something wrong with your Filter formula. I have made a test on my side, please consider take a try with the following workaround:

    ClearCollect(
     DRDierEvents;
     Filter(
     DierEvent;
     ExportDocaWW = 'ExportDocaWW (DierEvent)'.Yes;
     EventtypeId = 3;
     EventDatum >= ExportDatumBegin.SelectedDate;
     EventDatum < DateAdd(ExportDatumEind.SelectedDate; 1)
     )
    )

    Note: I assume that you configure "Yes" & "No" option for the "ExportDocaWW" field in your CDS Entity.

     

    More details about filter CDS Entity records based on "Two Option" type column, please check and see if the following blog would help in your scenario:

    https://powerapps.microsoft.com/en-us/blog/option-sets-and-many-to-many-relationships-for-canvas-apps/

     

    Best regards,

  • HansHeintz Profile Picture
    704 on at

    Yes it is a two option field type. 

    That fact that is can be treated as a Boolean field (in the gallery and in a separate filter) but not in a compound filter is
    inconsistent.

     

  • v-xida-msft Profile Picture
    on at

    Hi @HansHeintz ,

    Have you taken a try with the solution I provided above?

     

    Based on the issue that you mentioned, I think the formula I provided above could achieve your needs. The "Two Option" type column is actually a Option Set type column in CDS Entity, which is a separated data type supported in PowerApps, please refer to the following article:

    https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/data-types

     

    The "Two Option" type column could not be recognized as a Boolean type column within PowerApps app currently. Please modify your formula as I mentioned above, check if the issue is solved.

     

    Best regards,

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard