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

Setting a Text Box to a Variable Value

I am pulling data in from a Power BI connection, then I have a button which populates a set of text boxes with the data that I have selected in Power BI. I set the text boxes to variables, then set the variables with the data from Power BI. The text boxes populate fine, but if I edit the data in one of the text boxes, it loses connection to the variable and will not change back if I hit the populate button again.

 

I made a "reset" button that resets each text box back to its respective variable, but if I hit the populate button again, it won't repopulate and just stays at the value that I edited the text box to. Any ideas on why this is happening?

2 REPLIES 2
ChrisR
Level 8

Re: Setting a Text Box to a Variable Value

Not sure if your "reset" button did this, but if not, try resetting the text box.  Put a variable in the text box's Reset property and then toggle it true/false.  Something like:

 

Set(varReset,true);
Set(varReset,false)

 

 

 

 

Chris - IW Mentor PowerApps Training

Community Support Team
Community Support Team

Re: Setting a Text Box to a Variable Value

I think it is how the TextInput Box control works.

 

If you have value inputted, it will not keep the default value.

Reset the control should make it to show the default value again.

 

instead of the method mentioned by ChrisR, please take a try to add a button, then set the OnSelect property to:

 

UpdateContext({Variable1:true});UpdateContext({Variable1:false})

After that, modify the ReSet property of the TextInput control to:

 

 

Variable1

 

When you need to have the TextInput to show the default value, press the button, it will then reset it to the variables configured with the default property.

 

Regards,

Michael

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

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (8,605)