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 / Gallery, set default s...
Power Apps
Unanswered

Gallery, set default selection to first item

(0) ShareShare
ReportReport
Posted on by 6

I am having 2 Galleries, the one is 'Filter Gallery' and the second one is 'Filtered Items'. The Filter gallery works until I Select any Item in Filter Gallery. What I need is to show All Items in 'Filtered Items' by Default. 

Screen1.PNG
Categories:
  • RusselThomas Profile Picture
    4,014 on at

    Hi TezzChaudhary,

     

    The image you attached comes up with an error, and your subject seems to be different to what you've said in your message so I'll try answer with what I know.

     

    For the request in the subject "set default selection to first item";

    You can do this by setting the Default property of the FilterGallery to

    First(FilterGallery)

    If your FilteredItems Gallery is based on what is selected in the FilterGallery, then it should automatically filter based on the above - but it depends on the your Items property function.  What is it set to?

     

    Bear in mind the "Default" parameter is triggered on reset, so if you wish to reinforce the default after the first time the page is rendered, you would need to use the Reset property of the Gallery and trigger it manually.

     

    To your second question;

    "The Filter gallery works until I Select any Item in Filter Gallery. What I need is to show All Items in 'Filtered Items' by Default. "

    I'm not sure what you mean by 'works until I select any item in the filter gallery'.  

     

    Can you try upload the image again?

     

    Kind regards,


    RT

  • TezzChaudhary Profile Picture
    6 on at

    Thanks for reply RT, Actually I was trying to ask for set default selection to the first item in a gallery. The second Question is an issue actually, the filtered items show a blank screen until I click on any item of Filtered Gallery, as You can see in my attached Image.

    Also, First(tableName) didn't work for me.

     

    Thanks

    Screen2.PNG
    Screen3.PNG
  • RusselThomas Profile Picture
    4,014 on at

    Hi TezzChaudhary,

     

    It may be because the Default property is only used for first-time-render or Reset.  You won't trigger Default again unless you restart the app, or manually reset the gallery.

     

     

    To test with a manual reset, add a button to the screen and set it's OnSelect property to;

    Reset(FilterGallery)

     

    Make sure the Default property of FilterGallery is set to

    First(DataSourceName)

    Where DataSourceName is identical to the Items: property value of the Gallery.

     

    As an additional debug option, you can place a text label on the screen and set it's Text property to;

    FilterGallery.Selected.

    and pick a field from the record (eg: FilterGallery.Selected.Title or FilterGallery.Selected.ID) - but you already have a gallery based on FilterGallery.Selected so you probably don't need the text label.

     

     

    Run the screen and select a few different items to see if your label and/or items gallery updates properly.  Then hit the button to see if it resets the selection it to the first item and updates the items gallery.

     

    Kind regards,

     

    RT

  • iAm_ManCat Profile Picture
    18,256 Most Valuable Professional on at

    Hi @TezzChaudhary,

     

    Could you paste your code for the Items property of both of the Galleries, I have a feeling it will be around the filtering part that your issue arises.

    Without seeing your code I can only give you a general idea, but would help a lot if I could see what you have set up.
    You should be able to do something like this:

    SortByColumns(
       Filter(
          Properties,
              GalleryFilter = FilterGalleryDropDown.Selected.Value,

              (
                   FilterItems.Selected.Value = "All Items"
                   ||
                   Title = FilterItems.Selected.Value
              )
      ),
    "Title",
    Ascending
    )

     

     

    The Logic with this being that you are either filtering by the selection "All Items" which then returns 'true' and shows all items instead of filtering, or you are filtering by whatever item has been selected.

     

    Cheers,

    @iAm_ManCat

  • TezzChaudhary Profile Picture
    6 on at
    SortByColumns(If(type="All",Tickets,If(type="Closed", Filter(Tickets,Status="Closed"),If(type="Active",Filter(Tickets,Status="In Progress"),If(type="On hold",Filter(Tickets,Status="On Hold"),If(type="Not started",Filter(Tickets,Status="Not Started")))))),"Created",Descending)

    The Above code is of Items property of Filtered Gallery(Here 'Tickets' is a SharePoint List), while in Filter Gallery I am just calling a SharePoint List

  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @TezzChaudhary,

    Do you want to set the default selection to the first item of your data source within your Filter Gallery?

    I have made a test on my side, and don't have the issue that you mentioned. The screenshot as below:4.JPG

    For your first question, if you want to set the default selection to the first item of your data source within your Filter Gallery, please take a try with the following workaround:

    Set the Default proeprty of the Filter Gallery control to following:

    First(TicketTypes)

    Note: The TicketTypes represents the data source you typed within the Items property of the Filter Gallery.

     

    For your second question, do you use your SP list data source within the "Filtered Items" Gallery (Tickets Gallery) of this template app (Service desk) instead of Original embedded Excel table?

    The Original embedded data sources (e.g. TicketTypes, Tickets, etc) within this template app are all Excel table data source as below:5.JPG

    If you want to replace the Original embedded Excel table data source with your SP lists within this template app, please make sure your SP lists have same data structure as that within the Original embedded Excel table data sources as below:6.JPG

     

    7.JPG

    On your side, you could consider take a try to save this embedded Business Excel table data sources into your OneDrive folder (or OneDriver for Business, Dropbox, etc), then create your SP lists based on the data structure of these embedded Business Excel tables. After that, add your SP lists into this template app, then save and re-load this template app to check if the issue is solved.

    Note: You could find the embedded Business Excel tables through the following folder path:

    Your OneDrive Root folder -> PowerApps folder -> Templates folder -> ServiceDesk_eaxxxxxx-de38-xxxx-b1d7-58ef8d75xxxx -> data.xlsx

    Best regards,

    Kris

  • TezzChaudhary Profile Picture
    6 on at

    Thanks @v-xida-msft

     

    I have already tried that Solution but it didn't helped me.

     

    "do you use your SP list data source within the "Filtered Items" Gallery (Tickets Gallery) of this template app (Service desk) instead of Original embedded Excel table?"

    Actually I created this app from scratch, using SP list as a data source.

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 405 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 368

#3
WarrenBelz Profile Picture

WarrenBelz 244 Most Valuable Professional

Last 30 days Overall leaderboard