Wednesday, July 20, 2022

Powerapps : How to Set the Color of a Button/Label Dynamically

This post is to show how to change the color of a Text / Label / Button etc.. dynamically

We can set the text color by specifying the color in the color attribute, if we want to set the color with a static value.

ex:- 


But if you want to set the value dynamically, we can use a variable. But in this case we will have to use the ColorValue() function to achieve the expected result.

In the below example, on the button click, I am setting the dynamic variable to the value from the text box

Set(labelColor,TextInput1.Text)



Set the Color attribute on the label to 

ColorValue(labelColor)





Result



Reference: Color enumeration and ColorFade, ColorValue, and RGBA functions in Power Apps




Feel free to point out if anything is wrong/missing in this post.




No comments:

Post a Comment

Azure APIM : How to configure Azure APIM to call a REST API with OAuth Authentication

  In my project, we had a requirement to call a REST API using OAuth Authentication from Azure LogicApps.  We had configured APIM to do the ...