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 Based o...
Power Apps
Answered

Filter Gallery Based on Radio Control and Search Box

(0) ShareShare
ReportReport
Posted on by 5,331 Moderator

I have Gallery1 (SPList1/Collection1)

I have RadioControl1 (with three options - 'Subject', 'Status', 'Created By'.

I have ComboBox1, which I am using to search Gallery1.

How do I set the Gallery1 Items to display data based on the choice in RadioControl1 and the content entered into ComboBox1?

I have the following in FilterByCategoryRadioCntrl -
Items - ["Subject", "Status", "Created"]

I have the Following in ComboBox1 -
ComboBox1 - Switch(FilterByCategoryRadioCntrl.Selected.Value,
"Subject", RenameColums( Distinct(Collection1, Title), "Result", "Value"))
"Status", [" ", "Under Review"],
"Created By", RenameColumns( Distinct(Collection1, 'Created By), "Result", "Value"))

What do I need in Gallery1 so that is filters and switches based on the 'FilterByCategoryRadioCntrl' selection and 'ComboBox1' search content?


Categories:
I have the same question (0)
  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @Phineas ,

     

    Please try:

    If(
     FilterByCategoryRadioCntrl.Selected.Value="Subject",
     Filter(Collection1,Subject=ComboBox1.Selected.Value),
     FilterByCategoryRadioCntrl.Selected.Value="Status", 
     Filter(Collection1,Status=ComboBox1.Selected.Value),
     FilterByCategoryRadioCntrl.Selected.Value="Created By", 
     Filter(Collection1,'Created By'=ComboBox1.Selected.Value)
    )

     

    Best Regards,

    Bof

  • Phineas Profile Picture
    5,331 Moderator on at

    Got it all in.

    Getting the following error - "Incompatible types of comparison at the equal sign. These types can't be compared: Record, Table."

    I have this in Gallery1 -

    If(
    FilterByRadioCntrl.Selected.Value="Meeting Subject",
    Filter(Collection1,'Meeting Subject' = ComboBox1.Selected),
    FilterByRadioCntrl.Selected.Value="Status",
    Filter(Collection1,'Status' = ComboBox1.Selected),
    FilterByRadioCntrl.Selected.Value="Created By",
    Filter(Collection1,'Created By' = ComboBox1.Selected)) 

    The CombBox1 has - 
    Switch(
    FilterByCategoryRadioCntrl.Selected.Value,
    "Meeting Subject", RenameColumns( Distinct(Collection1,'Meeting Subject'), "Result", "Value"),
    "Status", [" ","Under Review"],
    "Created By", RenameColumns( Distinct(Collection1,'Created By'), "Result", "Value"))

  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @Phineas ,

    Please try:

     

    The CombBox1 - 
    Switch(
    FilterByCategoryRadioCntrl.Selected.Value,
    "Meeting Subject", RenameColumns( Distinct(Collection1,'Meeting Subject'), "Result", "Value"),
    "Status", [" ","Under Review"],
    "Created By", RenameColumns( Distinct(Collection1,'Created By'.Email), "Result", "Value"))

     

     

     

    Gallery1 -

    If(
    FilterByRadioCntrl.Selected.Value="Meeting Subject",
    Filter(Collection1,'Meeting Subject' = ComboBox1.Selected.Value),
    FilterByRadioCntrl.Selected.Value="Status",
    Filter(Collection1,'Status' = ComboBox1.Selected.Value),
    FilterByRadioCntrl.Selected.Value="Created By",
    Filter(Collection1,'Created By'.Email = ComboBox1.Selected.Value)

    )

     

    Best Regards,

    Bof

  • Phineas Profile Picture
    5,331 Moderator on at

    The ComboBox1 portion worked.

    I am getting the same error(s) with the Gallery formula.

    If I use 'Selected' I get -
    Incompatible types for comparison. These types can't be compared: Text, Record.

    If I use 'SelectedItems I get -
    Incompatible types for comparison. These types can't be compared: Text, Table.

    Current Gallery Items Formula -
    If(CategoryRadioCntrl.Selected.Value="Meeting Subject",
    Filter(Collection1,Title = ComboBox1.Selected),
    CategoryRadioCntrl.Selected.Value="Status",
    Filter(Collection1,'Status'.Value = ComboBox1.Selected),
    CategoryRadioCntrl.Selected.Value="Created By",
    Filter(Collection1,'Created By'.DisplayName = ComboBox1.Selected))

  • Verified answer
    v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @Phineas ,

     

    Please try;

    Gallery1 -

    If(
    FilterByRadioCntrl.Selected.Value="Meeting Subject",
    Filter(Collection1,'Meeting Subject' = ComboBox1.Selected.Value),
    FilterByRadioCntrl.Selected.Value="Status",
    Filter(Collection1,'Status' = ComboBox1.Selected.Value),
    FilterByRadioCntrl.Selected.Value="Created By",
    Filter(Collection1,'Created By'.Email = ComboBox1.Selected.Value)

    )

     

    Best Regards,

    Bof

  • Phineas Profile Picture
    5,331 Moderator on at

    I need to add a search, based on whether the logged in user is an 'Associate' (captured in Label1.Text), or not an 'Associate'.

    Shall I continue in this chat or start another?

  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @Phineas ,

     

    You could try:

     

    Search(

    If(
    FilterByRadioCntrl.Selected.Value="Meeting Subject",
    Filter(Collection1,'Meeting Subject' = ComboBox1.Selected.Value),
    FilterByRadioCntrl.Selected.Value="Status",
    Filter(Collection1,'Status' = ComboBox1.Selected.Value),
    FilterByRadioCntrl.Selected.Value="Created By",
    Filter(Collection1,'Created By'.Email = ComboBox1.Selected.Value)

    ),Label1.Text,"Associate")

     

    Best Regards,
    Bof

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 914

#2
11manish Profile Picture

11manish 627

#3
Valantis Profile Picture

Valantis 598

Last 30 days Overall leaderboard