cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
testaccPA
Level: Powered On

basics global variables

Hello, a beginner question, but I want to learn the behavior:

I declared a global text variable on onStart and bound it to the text of a label.

Now I want to manipulate the value with a button and let it show immediately in the label.

How do I do that?

Kind regards

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: basics global variables

@testaccPA 

For example, let's say you used this code in the OnStart property

 

Set(myVar,"hello world")

 

Put this code in the Text property of a label.

 

myVar

 

And finally, create a button and put this ocde in the OnSelect property

 

Set(myVar,"goodbye world")

 

Click the button.  The label will now read "goodbye world"

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

2 REPLIES 2
Dual Super User
Dual Super User

Re: basics global variables

In the OnSelect property of the button add the same formula you used in the OnStart property, but change the value.  If you set the text property of the label to the name of the variable you should see the new value as soon as you press the button.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Super User
Super User

Re: basics global variables

@testaccPA 

For example, let's say you used this code in the OnStart property

 

Set(myVar,"hello world")

 

Put this code in the Text property of a label.

 

myVar

 

And finally, create a button and put this ocde in the OnSelect property

 

Set(myVar,"goodbye world")

 

Click the button.  The label will now read "goodbye world"

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (6,039)