cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
testaccPA
Helper III
Helper III

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
mdevaney
Super User
Super User

@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
Pstork1
Dual Super User
Dual Super User

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.
mdevaney
Super User
Super User

@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."

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (6,995)