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 / How to filter Gallery ...
Power Apps
Unanswered

How to filter Gallery based on column value using a checkbox

(0) ShareShare
ReportReport
Posted on by 257

Hello, 

 

I have a PowerApp with a SharePoint List as the data source. 

What I basically would like to do is to filter the Gallery when a checkbox is selected.

 

My Gallery items section has : 

 

SortByColumns(Filter([@CollectionRequests], StartsWith(Title, TextSearchBox1.Text)), "Created", Descending) 

 

The relevant column is called 'Business Unit' in my SP list. 

On my OnCheck I have: 

Filter(CollectionRequests,'Business Unit'="CBRO")

 But I'm not sure how to modify my Gallery formula without losing current functionality.

 

 

In advance thank you !!!

help with checkbox.jpg

Categories:
I have the same question (0)
  • eka24 Profile Picture
    20,923 on at

    Assuming your checkbox1, 

    Change the filter on the Gallery to;

     

    If(Checkbox1.Value,

    SortByColumns(Filter([@CollectionRequests], StartsWith(Title, TextSearchBox1.Text)), "Created", Descending),CollectionRequests)

     

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • F_Quint Profile Picture
    257 on at

    @eka24 thanks for the reply. That doesn't seem to work. It's not filtering by the column value I want. It's also putting my gallery from oldest to newest when Unchecked. 

  • eka24 Profile Picture
    20,923 on at

    I have seen you modified the question. Do you want to combine the two codes with the checkbox?

     

    If(!Checkbox1.Value,

    SortByColumns(Filter([@CollectionRequests], StartsWith(Title, TextSearchBox1.Text)), "Created", Descending),

    SortColumns(

    Filter(CollectionRequests,'Business Unit'="CBRO"),"Created"))

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • F_Quint Profile Picture
    257 on at

    @eka24  Sorry about the ninja edit, I wanted to my question more specific.  

     

    but to answer your question, yes I would like to keep the Gallery's functionalities intact when the checkbox isn't checked. and when OnCheck, filter the Gallery from newest to oldest based on the Business unit column value 

     

  • eka24 Profile Picture
    20,923 on at

    Have you tried the new code I gave.

    If any issues give a screenshot

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • F_Quint Profile Picture
    257 on at

    @eka24  I tried but got the following error

    F_Quint_0-1596730909125.png

     

  • eka24 Profile Picture
    20,923 on at

    The attached is blurred, image not clear. Please resend

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • F_Quint Profile Picture
    257 on at

    @eka24 

     

    I pixelated the name of my collection and other identifying info.  

    Let me know if this is clearer. 

    Thanks for your help!

     

    help with checkbox.jpg

  • Verified answer
    eka24 Profile Picture
    20,923 on at

    Check the spelling of SortByColumns in the second line:

     

    If(!Checkbox1.Value,

    SortByColumns(Filter([@CollectionRequests], StartsWith(Title, TextSearchBox1.Text)), "Created", Descending),

    SortByColumns(

    Filter(CollectionRequests,'Business Unit'="CBRO"),"Created"))

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • F_Quint Profile Picture
    257 on at

    @eka24 That works! Thank you so much. 

     

    Now if I wanted to combine a drop-down into the formula? 

    I'll open a new question, much appreciated. 

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 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard