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 / button onselect change...
Power Apps
Answered

button onselect change text

(1) ShareShare
ReportReport
Posted on by 10

I added a button and a label. I want to click on the button and then change the text in the label. What I try to do is like the following:

 

Button: Onselect = label1.text = "abcdedf"

 

But I don't see any change of text. Can anyone point out my mistake?

Categories:
  • BitLord69 Profile Picture
    914 on at

    HI,

     

    You cannot change the text directly, so you have to use a variable.

     

    In the Button.Onselect you set the variable, either through the Set (for a global variable) or UpdateContext (for a local variable) function, and then you use the variable in the label's Text-property.

     

    Read more about how to use variables here: https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/working-with-variables

     

    Good luck!

  • kylechow Profile Picture
    10 on at

    So, if we want to use button to control other object. I need to use variable to do it? 

    I would like to know how can I add an new button to take photo? not using OnSelect function in camera.

  • Verified answer
    SpencerLynn Profile Picture
    Microsoft Employee on at

    Yes, that's a pretty good way to think about it. Variables can be used to drive the state in the application, for example from one control to another.

     

    As far as your camera question, today, clicking on the camera is necessary to capture the currently viewed image in the Photo property of the camera. However, you can still use a Button to capture that photo in a variable for the app, but users must still click on the Camera control first.

  • PytByt Profile Picture
    943 on at

    so whats the answer? and is there any simplier way to do it?

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
11manish Profile Picture

11manish 394 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 324 Most Valuable Professional

Last 30 days Overall leaderboard