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 / Switch for Gallery Search
Power Apps
Unanswered

Switch for Gallery Search

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

I have JobSummaryFilterByRadioControl that has three options. 

I have CombBox2_1 with a Switch command that display a list of choice based on the option made in the radio control.

I have Gallery1 that displays the content based on the choice made in the ComboBox.

JobSummaryFilterByRadioControl
items: ["Company Name", "Technician Name", "Truck VIN Number"]

ComboBox2_1
Items:
Switch(
JobSummaryFilterByRadioControl.Selected.Value,
"Technician Name", RenameColumns( Distinct(EmployeeListCollection,Title), "Result", "Value"),
"Company Name", RenameColumns( Distinct(SchedulerDetailsListCollection,CustomerName), "Result", "Value"),
"Truck VIN Number", RenameColumns( Distinct(SchedulerDetailsListCollection,CustomerName), "Result", "Value")
)

Gallery1
Items:
If(IsBlank(JobSummaryFilterByRadioControl.Selected.Value),'Schedule Details List', Filter('Schedule Details List', CustomerName in ComboBox2_1.Selected.Value))

How do I update the Gallery Items formula so that it displays content based on the choice made in the ComboBox.

I can get it to display for one choice but can't figure out how to get it to change/switch the Gallery1 content when the ComboBox changes source?

Phineas_0-1656695695494.png

 

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

    @Phineas 

    Your Items property on the combobox is not entirely clear as you have two options that produce the same data.

     

    My suggestion is to change your Items property on the Radio control to:

    Table(
     {Value: "Company Name", Items: RenameColumns(Distinct(EmployeeListCollection, CustomerName), "Result", "Value")},
     {Value: "Technician Name", Items: RenameColumns(Distinct(EmployeeListCollection, Title), "Result", "Value")},
     {Value: "Truck VIN Number", Items: RenameColumns(Distinct(EmployeeListCollection, CustomerName), "Result", "Value")}
    )

     

    Change the Items property on your Combobox to:

    JobSummaryFilterByRadioControl.Selected.Items

     

    Then change your Items property on your Gallery to:

    Filter('Schedule Details List', IsBlank(ComboBox2_1.Selected.Value) || CustomerName in ComboBox2_1.Selected.Value)

     

    I hope this is helpful for you.

  • Phineas Profile Picture
    5,345 Moderator on at

    I made all the changes you recommended.

    Power Apps liked everything except the last action (see below). Nothing be red in all fields of the Gallery.

    Filter('Schedule Details List', IsBlank(ComboBox2_1.Selected.Value) || CustomerName in ComboBox2_1.Selected.Value) || TechnicianName in ComboBox2_1.Selected.Value) || TruckVinNumber in ComboBox2_1.Selected.Value)

    I rolled it back to the following and I DID get data. How to I add the 'CompanyName' and 'TruckVinNumber' results to the formula?

    Filter('SEC Schedule Details List', IsBlank(ComboBox2_1.Selected.Value) || TechnicianName in ComboBox2_1.Selected.Value)

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

    @Phineas 

    So I'm a little confused as those are two different formulas and two different data sources.

    Is it the second one you have issues with or the first?

  • Phineas Profile Picture
    5,345 Moderator on at

    One should be a from the TechnicianName should be retrieved from the 'Employee List'.

    The other two ('CustomerName' and 'TruckVinNumber') should be retrieved from the 'Schedule Details List'.

    Which is why I was trying to go at the issue with the 'Switch' command.

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 220 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 189 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 139

Last 30 days Overall leaderboard