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 / Filtering a gallery wi...
Power Apps
Answered

Filtering a gallery with radio buttons

(0) ShareShare
ReportReport
Posted on by 332

I'm working on an app with 2 galleries connected to the same Sharepoint list. The list has a Title column that I use to filter the data in each gallery, using this formula:

 

Filter('My data source', StartsWith(Title,"Resid"))

 

Filter('My data source', StartsWith(Title,"Comm"))

 

I'm using StartsWith because the data in the Title column is an ID that contains numbers at the end. (Such as Residential_1, Residential_2, Community_1, Community_2, etc.).  I need the data to be filtered by Titles that start with Resid or Comm.

 

What I'd like to do is consolidate the two galleries into a single gallery, with two radio buttons beside it that are labeled "Residential" and "Community." When the Residential button is selected, the gallery is filtered by all the Titles that start with "Resid". When the Community button is selected, the gallery is filtered by all the Titles that start with "Comm."

 

Any suggestions would be appreciated. Thanks!

Categories:
I have the same question (0)
  • zmorek Profile Picture
    3,272 on at

    Make the Items property of your radio buttons something like this:

    Table({Title:"Community",Value:"Comm"},{Title:"Residential",Value:"Resid"})

     

    Then on your gallery:

    Filter('My Data Source', StartsWith(Title, RadioButton.Selected.Value))

     

     

  • T_A_M Profile Picture
    332 on at

    The filtering works perfectly, but my radio buttons are now labeled "Comm" and "Res." They should be labeled "Community" and "Residential." If I switch Title and Value in the formula, the radio buttons are labeled correctly but the formula doesn't work.

  • Verified answer
    zmorek Profile Picture
    3,272 on at

    Then set your Radio's Items property to: Table({Value:"Community",Title:"Comm"},{Value:"Residential",Title:"Resid"})

     

    And the Items property of the gallery to: 

    Filter('My Data Source', StartsWith(Title, RadioButton.Selected.Title))

  • T_A_M Profile Picture
    332 on at

    That did it. Thank you!!

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 June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 316 Most Valuable Professional

#2
11manish Profile Picture

11manish 242

#3
Valantis Profile Picture

Valantis 198

Last 30 days Overall leaderboard