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

Community site session details

Session Id : 3jNzG91FXuXa/bnws7+1DQ
Power Apps - Building Power Apps
Answered

Make gallery invisible upon making a selection

Like (0) ShareShare
ReportReport
Posted on 26 Feb 2024 22:04:26 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!

I have the same question (0)
  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    on 28 Feb 2024 at 03:27:56
    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 27 Feb 2024 at 14:29:47
    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 27 Feb 2024 at 04:34:44
    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 26 Feb 2024 at 23:52:56
    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 26 Feb 2024 at 23:13:19
    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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

MS.Ragavendar – Community Spotlight

We are honored to recognize Ragavendar Swaminatha Subramanian as our September…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 892 Most Valuable Professional

#2
Power Apps 1919 Profile Picture

Power Apps 1919 356

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 310 Super User 2025 Season 2

Last 30 days Overall leaderboard
Loading complete