Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Make gallery invisible upon making a selection

(0) ShareShare
ReportReport
Posted on by

Hello - I am building a Power App containing a gallery that the user will select an item from after searching for it.  This is a picture of the app so far: 

jessicadduffey_0-1708984818160.png

Gallery Properties: 

Items: Filter(AllOpenRoles,StartsWith(JobReqID,Textboxsearchinput.Text))

OnSelect: UpdateContext({varSelectedItem:ThisItem})

Visible: If(IsBlank(Textboxsearchinput.Text),false,true)

 

Once the user selects a gallery item from the list, I want the gallery to disappear (as you can see, the list still remains even when the text input is populated.  I'm newer to Power Apps and am stuck on how to make this happen.  Any suggestions for a property/formula that I could use?

 

Thank you!

  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    on at
    Re: Make gallery invisible upon making a selection

    Hi @jessicadduffey,


    @jessicadduffey wrote:

     So, to confirm, what I'm reading is that I need to leave the Visible property of the gallery blank and instead insert Reset(Textboxsearchinput) into the OnSelect property.  Is that correct?


    You need to reset the TextInput control after you select an item from the Gallery.

    Just set the OnSelect of your Gallery: 

    UpdateContext({varSelectedItem:ThisItem});Reset(Textboxsearchinput)
  • jessicadduffey Profile Picture
    on at
    Re: Make gallery invisible upon making a selection

    @Qi ah, OK...sorry, I'm a newbie and a lot of what I'm building has come from YouTube videos...I'm still learning a lot of the logic!  So, to confirm, what I'm reading is that I need to leave the Visible property of the gallery blank and instead insert Reset(Textboxsearchinput) into the OnSelect property.  Is that correct?

  • v-qiaqi@microsoft.com Profile Picture
    on at
    Re: Make gallery invisible upon making a selection

    Hi @jessicadduffey,

    I think there is a contradiction in the logic of your expression...

    You said that you want the gallery to disappear once the user selects a gallery item from the list, however, you set a variable to make the gallery appear once the search text is not blank, which is contradictory.

     

    You logic will make the Gallery appear always once the search text is not blank.

     

    So if you want to make the Gallery disappear, you need to clear the searchtext after you select an item from Gallery, which is what @AARON_C mentioned previously.

     

  • jessicadduffey Profile Picture
    on at
    Re: Make gallery invisible upon making a selection

    @AARON_C  basically, I want the user view to look like this: 

    jessicadduffey_0-1708991547034.png

    The number selected has populated in the text input, but the list is gone.  

  • AARON_C Profile Picture
    2,233 Most Valuable Professional on at
    Re: Make gallery invisible upon making a selection

    Hi @jessicadduffey,

     

    Once the gallery disappears, what are you trying to do?

     

    You can add this to the OnSelect property of the gallery:

    Reset(Textboxsearchinput);

     

    Please tick Accept as solution if the answer is useful.

    Thanks,

    @AARON_C 

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

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,668 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,004 Most Valuable Professional

Leaderboard