Changing button background color when clicked

Hello all,
Is there a way to change the button of the color when it is tapped? I’m using something similiar to ‘yes’ or ‘no’ in the app.

Solution I’m using now
I created 3 containers… when the button is clicked, based on which one is clicked, the visibility of the container gets toggled. This feels like a lot

I’m looking for a similiar solution to link up the color of the button with a formula. For some reason, it was working with the old version of AppGyver… but the latest version seems to have removed that ability.

Click on “New Palette” and change the value based on a formula. Here is an example:
IF(data.ppeappr011.fields.o_ppe_category==3, “rgba(200,16,46,1)”,“rgba(0,0,0,1)”)).

If you have multiple values options, you can nest color changes as well: IF(data.ppeappr011.fields.o_ppe_category==1, “rgba(5,136,14,1)”, IF(data.ppeappr011.fields.o_ppe_category==2, “rgba(255,255,0,1)”, IF(data.ppeappr011.fields.o_ppe_category==3, “rgba(200,16,46,1)”,“rgba(0,0,0,1)”)))

1 Like