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

PowerAutomate : How to send email from someone else using Sharepoint REST API

In this post I will explain how to send email as someone else and the reply to those email goes to this "someone". Business Scenar...