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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Deselect default galle...
Power Apps
Unanswered

Deselect default gallery items

(0) ShareShare
ReportReport
Posted on by 219

Hi,

I am using PowerApps with SharePoint that includes Gallery and SubGallery. 

Also trying to use Right arrow and Down arrow to show and hide SubGallery items but unsuccessful. 

Importantly, I found that by default, first of the main gallery item is getting selected. Please refer to the screenshot below. 

Can you please help me on this one to avoid any selection by default.

SumanthDundi7_0-1664281430015.png

 

 

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @SumanthDundi7 

    A Gallery always has something selected!  You cannot make nothing selected by default.

    If you want to avoid that, then you need to put your own selection action in place.  Meaning, use the OnSelect of the gallery to assign the selected row to a variable.  Then utilize that variable (instead of the ThisItem.IsSelected) to determine a selection.

     

    For example, very common to use the TemplateFill property to change the row color:

       If(ThisItem.IsSelected, Yellow, White)

     

    Instead, utilize a variable of the record in the OnSelect - Set(glbRecord, ThisItem)

    Then the TemplateFill would become:

       If(ThisItem.ID = glbRecord.ID, Yellow, White)

     

    And...never refer to yourGallery.Selected - as it will not be what you want.  Instead refer to glbRecord for the selected record.

     

    I hope this is helpful for you.

  • SumanthDundi7 Profile Picture
    219 on at

    Thank you so much but sorry @RandyHayes , I am not able to understand your point. What I understood is that we cannot have nothing selected by default.

     

    Can you please let me know as per my scenario.

     

     

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @SumanthDundi7 

    Yes, it was pretty much explained in my response.  The point is, the gallery has a selection - always!  If you don't want to use that (and you don't need to at all), then you can emulate it on your own.

    The sample I provided give a good idea on how to emulate the selection yourself.

  • PowerAppsJunkie Profile Picture
    151 on at

    @SumanthDundi7 

    Galleries actually can have nothing selected.  You can do so by placing {} in your default property of the gallery and nothing will be selected by default.  In this way you are telling your gallery that your default record is blank.  You can add deeper logic in how to select items etc..as Randy explained to use variables and you can use logic such as switch / if to determine your default property based on other conditions.  I know this is an older thread but wanted you to be aware the capability to select no records in a gallery is to use {} in the default property.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 366 Most Valuable Professional

#2
11manish Profile Picture

11manish 184

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 99 Super User 2026 Season 1

Last 30 days Overall leaderboard