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
Unanswered

Filter gallery based on a dynamic source (multiple Lists)

(2) ShareShare
ReportReport
Posted on by
Hi everyone,

I'm working on a PowerApps application that shows Machine Settings data for multiple products across multiple production lines and departments. I'm currently facing some issues with the interaction between a dropdown and a gallery. I have a dropdown on one screen that allows users to select a machine number, this then populates a gallery with all the products that are made on this machine. (This works perfectly)

The user then selects a product and it will take them to the next screen ("SetupScreen"). On this screen there is another gallery that then displays all records from my source. (Sharepoint list).
This used to work perfect when i was using a simple formula for the Items property on the gallery:
Filter('416 Machine Settings', ProductName.Value = SelectedProduct)

However, i needed to change this so it used a dynamic source and searched the correct list file based on the line name.
I changed the line dropdown to set a global variable "CurrentMachine". This variable will match the name of the source files.
Set (CurrentMachine, LineDropdown.SelectedText.Value & " Machine Settings")

I added the following formula to the gallerys items property on the "SetupScreen":
Switch(
    CurrentMachine,
    "402 Machine Settings", Filter('402 Machine Settings', ProductName.Value = SelectedProduct),
    "416 Machine Settings", Filter('416 Machine Settings', ProductName.Value = SelectedProduct),
    [] // Default case if no match
)

This is working partly as it adds the correct amount of records to the gallery but it will not pull the actual source data into each of the fields. The following no longer works but did before:
ThisItem. 'Machine Area'.Value

It would be much appreciated if someone can help please?
Let me know if you need more detail.

Thank you!
Categories:
I have the same question (0)
  • vipuljain03 Profile Picture
    673 Super User 2026 Season 1 on at
    ThisItem.Machine Area.Value is looking for a column named 'Machine Area' within the new table created by the Switch function, and it can't find it because the new table structure is different.
     
    Ensure that the relevant columns have the exact same internal name across all your SharePoint lists ("402 Machine Settings", "416 Machine Settings", etc.). This is case-sensitive! Check the column settings in SharePoint to confirm the internal names (they might be different from the display names).
     
    For example, if the internal name for "Machine Area" is actually "MachineArea" in all lists, then ThisItem.Machine Area.Value should work.
     
    Additionally, for maximum flexibility and performance, its always good to use collection, instead of directly referencing SharePoint list.
    E.g.
    ClearCollect(
        MachineSettingsCollection,
        Switch(
            CurrentMachine,
            "402 Machine Settings", Filter('402 Machine Settings', ProductName.Value = SelectedProduct),
            "416 Machine Settings", Filter('416 Machine Settings', ProductName.Value = SelectedProduct),
            []
        )
    );
    ------------------------------------
    If this reply helped you, please mark this reply as suggested answer ✔️ and give it a like to help others in the community find the answer too!
    Thanks,
    Vipul

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

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 1,045

#2
Valantis Profile Picture

Valantis 675

#3
11manish Profile Picture

11manish 592

Last 30 days Overall leaderboard