Saturday, 11 July 2020

Set Label Text on a Button Click or Select - Power Platform - Canvas Apps


Hi Everyone,

I have started on PowerApps and as I am newbie on this, I am trying to understand the things clearly before we do.

Today I got a requirement to set the label text to something onclick of a button, oh.. sorry.. onselect of a button(powerapps terminology :)). I thought, it would be the same way of the statement which we are so used and have written below statement onselect.

lblTextToShow.Text = "Set Label Text from OnSelect Property of the button."

And, it didn't work. After some search, understood that we cannot change the text directly like above and we have to use a Variable to do the same.

We have to set the Text property of the label to the Variable (Global or Context) and change the value of the Variable OnSelect of the button and label text would change automatically.

On the Form OnVisible property have given the below formula to set the variable value to Blank() and assigned the same variable to Label Text property on OnSelect Property of the button by setting the value that I want.


Hope this helps.

--
Happy App Developing
Gopinath

No comments:

Post a Comment