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 a gallery with ...
Power Apps
Answered

Filter a gallery with buttons where columns are all text (not choice columns)

(0) ShareShare
ReportReport
Posted on by

Hello,

 

I am working on a Time Tracker app to help me better understand how much time I am spending on various tasks. I added a gallery screen so I can edit entries if needed (e.g. I forgot to log in or log out at the correct time).

 

2022-03-04_09-33-10.png

Normally this would be pretty straightforward, but all of my categories and subcategories are text-based and I haven't tried to filter a gallery with buttons before, just dropdowns, so I'm kind of stuck. 

 

Here is a snapshot of my list settings for the Categories and Subcategories. These are used in the entry form via cascading dropdowns.

ProjectCategoriesListSettings.png

Here is a snapshot of my 'Project Time Spent' SharePoint List where the information from the form is recorded via a Patch formula.

ProjectTimeSpentListSettings.png

The name of my gallery is "galActivities". Here is the current Items property. The Search box is working fine, but the "ID" has double blue lines. I expect to eventually have thousands of entries so delegation is a concern.

Sort(Filter('Project Time Spent', StartsWith(Description, txtSearchBox.Text)),"ID", Descending)

 

The button gallery Items formula is:

Table({Tab: "All"}, {Tab:"Admin"}, {Tab: "Mtgs"}, {Tab: "Emps"}, {Tab: "Tools"}, {Tab: "D4G"})

 

The OnSelect of the button control is:

UpdateContext({varTab: ThisItem.Tab})

 

Thank you in advance for your help,

Teresa

Categories:
  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @tagustin2020 

    You've pretty much got all the groundwork done.  Just need to update your Items property formula.

    I am not sure though if it is the category or subcategory that the buttons represent. 

    So, if I assume the category, then the Items formula would end up like this:

    Sort(
     Filter('Project Time Spent', 
     StartsWith(Description, txtSearchBox.Text) &&
     ((Coalece(varTab, "All") = "All") || Category = varTab)
     ),
     ID, 
     Descending
    )

     

    Remove the double quotes from the ID and that should all do well.

     

    I hope this is helpful for you.

  • tagustin2020 Profile Picture
    on at

    @RandyHayes 

     

    Thank you Randy. That worked perfect. Thanks for the leg up 😊

     

    Have a nice weekend!

    Teresa

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @tagustin2020 

    As always...happy to help 😁

    Have a great weekend too!!

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 337 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 250

#3
Mohsin Ali Profile Picture

Mohsin Ali 225

Last 30 days Overall leaderboard