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

show hide buttons in gallery

hey there I have a navigation component including buttons in a gallery in my canvas app , and from those buttons I want a functionality to show / hide a button when any button is clicked
for example I have Pharmacy button and below it two more buttons pharmacists and pharmacies
so I wanted on click of pharmacy button then only pharmacists and pharmacies button will be show up in the gallery other wise both buttons hidden 

Super User
Super User

Hi @Harsh_4406 ,


Assuming your component uses a gallery to create the buttons, you might want to filter the items of the gallery to not include the currently selected item, for instance:


Gallery.Onselect = Set(varSelected,ThisItem.Title)

Gallery.Items = Filter(YourDataSource, Title <> varSelected)

Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.

hey thanks for the reply but this is not what i want
i am now sharing you a screenshot
actually i've made a collection to show button title in the gallery and for navigation,
if i have 3 buttons and i want to hide and show last 2 buttons on selection of 1st button
is it possible using collection in gallery

Super User
Super User


You would use a context variable. For example in the OnSelect property of the button UpdateContext({showparm:true}) and in the Visible property of the other two: showpharm.

You could toggle the first button as well:


Helpful resources

Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

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 Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

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