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

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (26,887)