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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Filter gallery through...
Power Apps
Unanswered

Filter gallery through checkboxes

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi there,

 

I have an issue with a gallery in PowerApps. The gallery displays items filtered from a SharePoint list column calles "Current Approval Status". At the moment the gallery displays the list items of three (out of seven) of the possible status values. 

 

The code I am using to do this is:

 

Sort(Filter('IT Project Approval Request';'Current Approval Status'.Value="Approved by IT Manager" Or
'Current Approval Status'.Value="Ready for examination" Or 'Current Approval Status'.Value="Ready for final decision");ID;Descending

 

I now want to filter the gallery by using three different checkoxes, displaying the different approval status possibilities.

So one Checkbox sorts by "Approved by IT Manager", the other by "Ready for examination" etc. and if two checkboxes are selected the respective items should be displayed.

 

Does anyone have an idea how to do that?

 

Dorothee

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    156,456 Most Valuable Professional on at

    Hi @Anonymous ,

    Using Approved, Examination and Decision as the names of your check boxes (change to your names) try this.

    Sort(
     Filter(
     'IT Project Approval Request';
     If(
     Approved.Value=true;
     'Current Approval Status'.Value="Approved by IT Manager" &&
     Examination.Value=true;
     'Current Approval Status'.Value="Ready for examination" &&
     Decision.Value= true;
     'Current Approval Status'.Value="Ready for final decision"
     )
     );
     ID;
     Descending
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @WarrenBelz Thank you. 

     

    How can I add that, if none of the boxes are selected I want to show all items with either of the three statuses?

     

    (Like in my code -> 'IT Project Approval Request';'Current Approval Status'.Value="Approved by IT Manager" Or
    'Current Approval Status'.Value="Ready for examination" Or 'Current Approval Status'.Value="Ready for final decision")

     

     

  • WarrenBelz Profile Picture
    156,456 Most Valuable Professional on at

    Ok @Anonymous ,

    I provided a solution for your query - you did not mention this aspect. Your additional requirements could be met with something like - note I am trying to provide suggested structure - you may have to clean up the commas & brackets etc.

    Sort(
     If(
     Approved.Value=false && Examination.Value=false && Decision.Value= false;
     'IT Project Approval Request';
     Filter(
     If(
     'IT Project Approval Request';
     Approved.Value=true;
     'Current Approval Status'.Value="Approved by IT Manager" &&
     Examination.Value=true;
     'Current Approval Status'.Value="Ready for examination" &&
     Decision.Value= true;
     'Current Approval Status'.Value="Ready for final decision"
     )
     )
     );
     ID;
     Descending
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @WarrenBelz Thanks, Warren. One more question: When I want to select 2 out of three checkboxes and filter the results in my gallery accordingly, how should I modify my code?

  • WarrenBelz Profile Picture
    156,456 Most Valuable Professional on at

    Hi @Anonymous ,
    I used an && (and) separator - it should work in the current format.

    Please let me know if it does not produce the results you want

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @WarrenBelz Unfortunately it doesn't. One I select multiple checkboxes, the gallery doesn't display any items at all.

     

    I am using the following formula:


    Filter(
    'Datasource';
    If(
    Checkbox_1Value=true;
    'Current Approval Status'.Value="Approved by IT Manager" &&
    Checkbox_2.Value=true;
    'Current Approval Status'.Value="Ready for examination" &&
    Checkbox_3.Value=true;
    'Current Approval Status'.Value="Ready for final decision";
    'Current Approval Status'.Value="Approved by IT Manager" Or
    'Current Approval Status'.Value="Ready for examination" Or
    'Current Approval Status'.Value="Ready for final decision")
    )

  • WarrenBelz Profile Picture
    156,456 Most Valuable Professional on at

    OK @Anonymous ,

    I have a working solution that surprised me a bit. however if it is below - same principle as yours

    ThreeBoxFilter.gif

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

    Code is as follows

     

     

    If(
     !Approved.Value && !Examination.Value && !Decision.Value;
     'IT Project Approval Request';
     Filter(
     'IT Project Approval Request';
     If(
     Approved.Value;
     'Current Approval Status'.Value="Approved by IT Manager"
     ) ||
     If(
     Examination.Value;
     'Current Approval Status'.Value="Ready for examination"
     ) ||
     If(
     Decision.Value;
     'Current Approval Status'.Value="Ready for final decision"
     )
     )
    )

    you can add the Sort.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    This is the code I ended up with after working through the examples you gave, thank you.  Even though I am comparing two string values I am getting a delegation warning.  I was hoping filtering with string type data would have avoided that. 

     

    If(
    chkBox1.Value=false && chkBox2.Value=false && chkBox3.Value=false,
    'Sharepoint List Name',
    Filter(
    'Sharepoint List Name',
    If(
    chkBox1.Value=true,
    ListColumn="ListColumnValue1"
    ) ||
    If(
    chkBox2.Value=true,
    ListColumn="ListColumnValue2"
    ) ||
    If(
    chkBox3.Value= true,
    ListColumn="ListColumnValue3"
    )
    )
    )

  • lcraig09 Profile Picture
    4 on at

    Hi, I got this code in my app, it works when using the ALT key and clicking on the boxes. But when I run the app it displays nothing in my list.

  • tvunguyen Profile Picture
    8 on at

    Hi WarrenBelz,

    Thank you for your help I was getting stuck on this. It does work but I'm getting a delegation error. Any Idea why this is happening?

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 356 Most Valuable Professional

#2
11manish Profile Picture

11manish 225 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 211

Last 30 days Overall leaderboard