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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to hide other labe...
Power Apps
Answered

How to hide other label depending on which button is click

(0) ShareShare
ReportReport
Posted on by 38

Hello guys I need your help,


I have 2 buttons and 2 labels. They are called button1, label1 and button2, label2

 

On Button1 for the OnSelect property I have:
Set(button1pressed, “Button1”)

For Label1 for the Visible property I have:
If(button1pressed = “Button1”, true, false)

 

On Button2 for the OnSelect property I have:
Set(button2pressed, “Button2”)

For Label2 for the Visible property I have:
If(button2pressed = “Button2”, true, false)

 

If a user selects button1 then the label1 displays as expected and if the user selects button2 then the label2 displays as expected too.

But what I’m trying to accomplish is when a user clicks on button1 show label1 and if the user then clicks on button2 then show label2 BUT hide label1. Any idea on how to accomplish this?

Any help is appreciated

Categories:
I have the same question (0)
  • Verified answer
    BCBuizer Profile Picture
    22,505 Super User 2025 Season 2 on at

    Hi @Learner ,

     

    Instead of using two variables, use 1:

     

    On Button1 for the OnSelect property I have:
    Set(buttonpressed, “Button1”)

    For Label1 for the Visible property I have:
    buttonpressed = “Button1”

     

    On Button2 for the OnSelect property I have:
    Set(buttonpressed, “Button2”)

    For Label2 for the Visible property I have:
    buttonpressed = “Button2”

     

    Also you can see I removed the If() clauses as the condition in there will return a Boolean on its own.

  • Learner Profile Picture
    38 on at

    Hello @BCBuizer  ,

    I tried it and totally worked. Thanks a lot for help and replying, I've been trying to figure out this for some time. 

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard