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

Change Label,Text, Image

Hello
If I press on a button I would like:

 

1. Change the label text
2. Give the text field a new text.
3. Assign another image to the control

 

How does it work ? Thank you

1 ACCEPTED SOLUTION

Accepted Solutions

Apologies guys I have solved it, Set(ButtonText,"Today") on each button go do the same thing for onselect, Set(ButtonText, "Tomorrow") and so on, then go to text field you want the label to show and just type ButtonText. 

 

I was over thinking it. 🙂 

 

Enjoy the rest of your day.

View solution in original post

6 REPLIES 6
Power Apps
Power Apps

You can try Context Variables,

 

Basically Change the OnSelect property of the button to be something like

 

UpdateContext({pressed: true})

Then the Label Text Propety of the label can be something like this

If(pressed = true, "value1", "value2") 

 

Then the Label Default Propety of the text field can be something similar to the above one as well

If(pressed = true, "value1", "value2") 

 

and we can use the a similar formula for image as well by setting the Image Propety to :

If(pressed = true, Image1.Image, Image2.Image) 

 

 

Hi Guys

 

Thanks for all your help, This forum always has the answers im looking for. however I am trying to have a button.text update to multiple different text inputs.

For example:

I have a gallery filtering "today" Tasks, I have made show today using onselct UpdateContext({pressed:true}) and text field is If(pressed=true,"Today","") Works perfectly with true false.

 

How would I have button.text change with other buttons to, "Today", "Tomorrow", "Yesterday"... more than 2 changes?

 

Any help would be appreciated

thank you most kindly

Apologies guys I have solved it, Set(ButtonText,"Today") on each button go do the same thing for onselect, Set(ButtonText, "Tomorrow") and so on, then go to text field you want the label to show and just type ButtonText. 

 

I was over thinking it. 🙂 

 

Enjoy the rest of your day.

View solution in original post

@AKotb 

 

Hello,

 

i have problem this syntax: If(pressed = true, "value1", "value2")

 

dont work for me now in 2019 was there any changes or somethin like that?

im getting error:  it contains error ParenClose where error is expected.

 

Thanks for answer,

 

John

Hi @Corbie 

 

Could you show the syntax you using or a screenshot and I can assist further? 

 

If it is complaining about a parenClose make sure you have all your syntax-correct with "(" ")" and "{" "}" if they are needed.

@SnowFlake 

 

Hello,

 

I figure it out: It was cause of differen language in browser.

 

Thanks for answer anyway.

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (3,332)