web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / basics global variables
Power Apps
Answered

basics global variables

(0) ShareShare
ReportReport
Posted on by 104

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

Categories:
I have the same question (0)
  • Pstork1 Profile Picture
    69,657 Most Valuable Professional on at

    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.

  • Verified answer
    mdevaney Profile Picture
    29,991 Moderator on at

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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard