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 / Trying to do ANYTHING ...
Power Apps
Answered

Trying to do ANYTHING on click of an image

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

A newbie here (1st time with Power Apps). I am trying to either hide a label or change it's color when an image is clicked. You know, basic stuff. 

 

Using the attached image for reference --

For the image named "btn", I have tried using the OnSelect with:

btn.Visible=false

and 

Label2.Color = Red

However, nothing changes when I run it.

Ideas?

SharedScreenshot.jpg
Categories:
I have the same question (0)
  • Verified answer
    Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    Hi @Keltanis 

    Use a context variable to make your changes. In the OnSelect property of the image: UpdateContext({var:false, clr:Red}) and set the Visible property of the control to var and the color property of label2 as clr. In the OnVisible property of the screen containing the controls use UpdateContext({var:true, clr:green})  as an example of setting the default property of the image and the label.

  • CarlosFigueira Profile Picture
    Microsoft Employee on at

    Welcome to the Power Apps platform :). To do what you want, you can use a variable that would be bound to the visibility (or the color), and change that in the OnSelect property of your image.

    For example, if you set the initial values in the App.OnStart property:

    Set(buttonVisibility, true);
    Set(labelColor, Color.White)

    And set the Visible property of the button to 'buttonVisibility' and the Color property of the label to 'labelColor', you can change the visibility and color with this expression in the OnSelect property of your image:

    Set(buttonVisibility, false);
    Set(labelColor, Color.Red)

     Hope this helps!

  • Verified answer
    BR-30101711-0 Profile Picture
    Microsoft Employee on at

    Thanks. This worked the best for what I was trying to do.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 525 Most Valuable Professional

#2
Haque Profile Picture

Haque 273

#3
Kalathiya Profile Picture

Kalathiya 232 Super User 2026 Season 1

Last 30 days Overall leaderboard