cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
v-yamao-msft
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
v-yamao-msft
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

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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,939)