cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

Text assign on button click

Hi,

 

If I click a button then it should assign some text for ex: "Hi" to a text box.

 

How can I achieve this?

 

Capture.PNG

 

If I click this button that "Text" should change to "Hi".

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Hi Gopi,

 

About the button control, set its Onselect property to UpdateContext({Test:"Hi"})
About the Text box control, set its Text property to Test.

 

Then when the button is clicked, “Hi” would be in the Text box. Hope this can be a reference for you.

 

More details about PowerApps UpdateContext function, please refer to this article:
https://powerapps.microsoft.com/en-us/tutorials/function-updatecontext/

 

Best regards,
Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Highlighted
Community Support
Community Support

Hi Gopi,

 

About the button control, set its Onselect property to UpdateContext({Test:"Hi"})
About the Text box control, set its Text property to Test.

 

Then when the button is clicked, “Hi” would be in the Text box. Hope this can be a reference for you.

 

More details about PowerApps UpdateContext function, please refer to this article:
https://powerapps.microsoft.com/en-us/tutorials/function-updatecontext/

 

Best regards,
Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted

I dont understand this statement "Then when the button is clicked, “Hi” would be in the Text box. Hope this can be a reference for you." Coz when I try to add TextInput1.Text=Test, it says circular reference.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (7,696)