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!

Report
All responses (
Answers (