Hello everyone,
I am running into a frustrating issue with the updated Modern ComboBox and Modern Dropdown controls where conditional logic seems to break the expected schema, throwing an error referencing ThisItem.Value1.
My Setup:
I have a Modern Dropdown (modernDropdown1) with options: "Option1", "Option2", and "Option3".
Depending on what the user selects, I want a Modern ComboBox's Items property to dynamically provide a specific array of text options. I am using the following Power Fx formula in the ComboBox's Items:
Switch(
Text(modernDropdown1.Selected.Value),
"Option1", ["Option1.1", "Option1.2", "Option1.3", "Option1.4"],
"Option2", ["Option2.1", "Option2.2", "Option2.3", "Option2.4", "Option2.5", "Option2.6"],
"Option3", ["Option3.1", "Option3.2"],
[]
)
The Problem:
According to the Microsoft Modern Control documentation:
"For string arrays, this property [ItemDisplayText] defaults automatically... to ThisItem.Value for string arrays"
However, when using the Switch formula above, Power Apps seems to generate an anonymous table schema underneath that it doesn't recognize. The ComboBox throws an error stating it is looking for ThisItem.Value1.
If I change the ComboBox ItemDisplayText to ThisItem.Value1, ThisItem.Value, or even try to force an explicit table schema using Table({Value: "Text"}), it either displays the literal text word "Value" for every item or continues to throw schema mismatch errors.
What I've Tried:
-
Wrapping the dropdown selection in Text() to prevent type mismatches.
-
Manually forcing the right-hand UI panel property to "Value".
-
Rewriting the inline arrays into explicit Table() structures inside the Switch.
It seems like the new Fluent-themed Flyout engine in the modern ComboBox struggles to determine the schema when an inline string array is evaluated conditionally inside a Switch.
Has anyone found a workaround to use conditional arrays with the new modern ComboBox controls without having to resort to creating a pre-defined App ClearCollect collection?
Thanks in advance!