Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PowerApps How can I change the text in a textbox on the click of a button

Tags:

powerapps

I'm trying to do a simple task of changing the text in a text box, on the click of a button in PowerApps.

I have a button "Button1" - and a textbox "TextInput2" on my page.

The buttons OnSelect action is set to: TextInput2.Text = "hello"

Nothing happens when I click the button. The textbox's text remains unchanged.

I also tried UpdateContext({TextInput2:"Hi"}) in the OnSelect action of the button.

Is there a way of doing this in PowerApps, that I may just be missing?

Thank you, Mark

like image 818
Mark Tait Avatar asked Sep 14 '25 15:09

Mark Tait


1 Answers

Finally getting my head around PowerApps.

Set the textbox's text property to:

If(HasBeenPressed, "Hello", "GoodBye")

Set the button's OnSelect event to:

UpdateContext({HasBeenPressed:true})

...and it's working.

I hope this helps others.

like image 90
Mark Tait Avatar answered Sep 17 '25 20:09

Mark Tait