cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Power_Automater
Helper IV
Helper IV

How to toggle label visibility with a button/icon

I have a help icon and a help label with some text. By default I would like the label to not be visible. When the help icon is clicked if the label isn't visible I would like it to be set to visible and the label is visible clicking on the icon should hide it, toggling the visibility. I have tried to follow these steps but once the label appears clicking the icon doesn't hide it, and also the label doesn't get hidden by default.

1 ACCEPTED SOLUTION

Accepted Solutions
phipps0218
Super User
Super User

One workaround is to have two icons. One that hides and one that shows the label. Obviously only ever showing one so for example


On Click property:

Icon 1 - Set(IconVisible, false); Set(LabelVisible, true)
Icon 2 - Set(IconVisible, true); Set(LabelVisible, false)

Visible Property:

Icon1 - IconVisible

Icon2 - IconVisible

Label - LabelVisible

 

Please Accept as Solution if it solves your question. Or just give it a Thumbs Up if it is helpful because this can help others.

LinkedIn: https://www.linkedin.com/in/charlie-phipps-%F0%9F%91%A8%E2%80%8D%F0%9F%92%BB-91338715b/
YouTube: https://www.youtube.com/channel/UChmFBGU1YKIU91sNMQ7buGg
Twitter: https://twitter.com/phipps0218

View solution in original post

3 REPLIES 3
phipps0218
Super User
Super User

One workaround is to have two icons. One that hides and one that shows the label. Obviously only ever showing one so for example


On Click property:

Icon 1 - Set(IconVisible, false); Set(LabelVisible, true)
Icon 2 - Set(IconVisible, true); Set(LabelVisible, false)

Visible Property:

Icon1 - IconVisible

Icon2 - IconVisible

Label - LabelVisible

 

Please Accept as Solution if it solves your question. Or just give it a Thumbs Up if it is helpful because this can help others.

LinkedIn: https://www.linkedin.com/in/charlie-phipps-%F0%9F%91%A8%E2%80%8D%F0%9F%92%BB-91338715b/
YouTube: https://www.youtube.com/channel/UChmFBGU1YKIU91sNMQ7buGg
Twitter: https://twitter.com/phipps0218

Power_Automater
Helper IV
Helper IV

This is a great idea @phipps0218 , I have done the above now but I am wondering how do I set the initial values of these variables? I have added the following to the screen OnVisible and the App OnStart but all of the objects are still not showing, I am guessing due to the variable being set to "no value" by default?

Set(IconVisible, true); Set(LabelVisible, false)

Power_Automater
Helper IV
Helper IV

Never mind, I found the Run OnStart button in the App triple dot menu. Thank you

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Apps Ideas

Check out the New Ideas Site

We are excited to announce a new way to share your ideas for Power Apps!

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