Skip to main content

Notifications

Community site session details

Community site session details

Session Id : L97ev4M33c6gXZXWSkGSHF
Power Apps - Building Power Apps
Answered

Setting the Visible property from a Button

Like (0) ShareShare
ReportReport
Posted on 11 Mar 2020 08:19:01 by 206

I have a gallery within my powerapp (GalleryApp) and I have a button in there which when pressed displays a drop down box.  The problem I have is that when the Button is pressed every instance of the drop box appears all the way down the gallery.  Is there a way that I can set the visible property on the drop box so that only the individual dropbox appears when the button is pressed?

Categories:
  • Station1901 Profile Picture
    206 on 11 Mar 2020 at 10:25:59
    Re: Setting the Visible property from a Button

    Thankyou, this works exactly how I wanted it to.

  • Verified answer
    Community Power Platform Member Profile Picture
    on 11 Mar 2020 at 09:33:27
    Re: Setting the Visible property from a Button

    Try setting the OnSelect property of the button to the following:

     

    UpdateContext({varBtnPressed: false}); Select(Parent); UpdateContext({varBtnPressed:!varBtnPressed})

     

    Have had a test my end with this and seems to be working, "moving" the dropdown to whichever gallery item is selected.

  • Station1901 Profile Picture
    206 on 11 Mar 2020 at 09:20:11
    Re: Setting the Visible property from a Button

    Thanks for getting back to me.  This almost works, it does show & hide the dropdown box but if I click on a button further down the gallery it also shows & hides the other instances

  • Community Power Platform Member Profile Picture
    on 11 Mar 2020 at 09:13:11
    Re: Setting the Visible property from a Button

    Hi @Station1901 

     

    Set the OnSelect property of your button to:

     

    Select(Parent);UpdateContext({varBtnPressed:!varBtnPressed})

     

    And the visible property of your dropdown to:

     

    varBtnPressed && ThisItem.IsSelected

     

    This should achieve what you're looking for đꙂ

  • Station1901 Profile Picture
    206 on 11 Mar 2020 at 08:54:12
    Re: Setting the Visible property from a Button

    I have tried this but it is still the same.  It either shows every drop box in the gallery or hides every dropbox.  I only want it to show or hide the indvidual instance 

  • MacWin Profile Picture
    153 on 11 Mar 2020 at 08:38:23
    Re: Setting the Visible property from a Button

    Set a variable like on the click event like this

    Set(ButtonPressed; true);; UpdateContext({ButtonPressed : !ButtonPressed}

     

    Set this code on the component you want to make visible false and true.

     

    If(ButtonPressed = true; true; false)

     

    Im using a different language. So my ";" are "," probably in your version 🙂

     

     

     

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,645 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,997 Most Valuable Professional

Leaderboard
Loading started