Ok. What I'm trying to do is pretty simple. I have a screen with multiple buttons. All I want to do is when a user clicks on a button, it changes the background color (to indicate it's selected). So for instance, the button is set to Primary in the Style & Theme area. Looking at other documentation, it seems like I should be able to set the Fill property of the button with a simple Update Context True/False statement in the OnSelect property.
When I look at the properties for the button, there is no Fill property. The closest I see is Appearance or BasePaletteColor. What am I missing? New to PowerApps but this seems like it should be a fairly easy thing to do. Any help would be appreciated.
BasePaletteColor:
If(LookUp(colButtonStates, Name = Self.Text, State) = "Pressed", RGBA(146, 200, 0, 1))
OnSelect:
With(
{currentState:LookUp(colButtonStates, Name = Self.Text)},
If(
IsBlank(currentState),
Collect(colButtonStates, { Name: Self.Text, State: "Pressed" }),
Patch(
colButtonStates,
currentState,
{ State: If(currentState.State = "Pressed", "Not pressed", "Pressed") })))
Makes total sense. Thank you for your help!
@gbach2290 - unless a modern control contains a feature/allows the user to do something which a classic control cannot replicate, I would stick to deploying an app with classic controls into your production environment as they are robust and not prone to the possible defects inherent with preview controls.
Well, I'll be.... didn't know there was a difference. I can see now. Thanks so much. BTW I did manage to figure out my issue with the modern button. Now I'll just have to see if I want to switch out my modern buttons for classic buttons.
@gbach2290 - because modern controls remain in preview, they are not as fully featured as Classic controls. If you add the classic Button control into your app, you will see the Fill property.
WarrenBelz
89
Most Valuable Professional
MS.Ragavendar
60
Michael E. Gernaey
42
Super User 2025 Season 1