cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

button onselect change text

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?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Power Apps
Power Apps

Re: button onselect change text

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.

View solution in original post

4 REPLIES 4
Highlighted
Power Participant
Power Participant

Re: button onselect change text

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!

Highlighted
Frequent Visitor

Re: button onselect change text

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.

Highlighted
Power Apps
Power Apps

Re: button onselect change text

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.

View solution in original post

Highlighted
Post Prodigy
Post Prodigy

Re: button onselect change text

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

Helpful resources

Announcements
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

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