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 / Default filter on gallery
Power Apps
Answered

Default filter on gallery

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I have a gallery with different work items. I have already created a dropdown list that is connected to my gallery (the dropdown has different status of the current work items). I also want to filter on the specific tagg \Business Tracks\Make by default. so when I am at the page it shows only work items with the tagg Make and then I can filter by status (by choosing the right status in the dropdown list).

 

GalleryGalleryDropdown listDropdown listLabelLabelexcelexcel

Categories:
  • Pstork1 Profile Picture
    69,661 Most Valuable Professional on at

    How is the default filter set?  Is it always the same?  If it is then you simply need to add it to the Search() or Filter() formula being used for the Items property of the gallery.  I usually do this by adding it as either a variable or a hidden label on the screen. Then set that value and use that in your Search/Filter string.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I have now changed the default to following: Filter(Tickets, isFolder=true && "\Business Tracks\Make" in AccountName)

     

    But it is not working. 

    default filter.jpg

  • Pstork1 Profile Picture
    69,661 Most Valuable Professional on at

    What data source is the content coming from?  And what is the AccountName field?  Shouldn't you be tesing against Path or something similar?

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    It is coming from an Excel file published on onedrive. 

    Account name.jpg

  • Pstork1 Profile Picture
    69,661 Most Valuable Professional on at

    Try '=' or StartsWith() instead of 'in'.  You are trying to check a field value where in checks to see if the value is in the column, not the specific record.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Still error, I have tried with both method '=' and 'StartsWith()'

    startswith.jpg

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

    Hi @Anonymous ,

    Based on the formula you provided, I think there is something wrong with it. The Default property of the Gallery control is required to provide a record value, but the Filter formula you provided returns a Table value.

     

    As an alternative solution, please consider take a try with the following workaround:

    Set the OnVisible property of the Make screen to following:

    ClearCollect(
     InitialCollection, 
     Filter(Tickets, isFolder = true, "\Business Tracks\Make" in AccountName)
    )

    Set the Items property of the Gallery to following:

    If(
     !IsEmpty(InitialCollection),
     InitialCollection,
     Filter(Tickets, Status = Dropdown1.Selected.Result)
    )

    Set the OnSelect property and OnChange property of the Dropdown1 to following:

    Clear(InitialCollection)

    Please consider take a try with above solution, then navigate to another screen, and then navigate back to the Make screen (fire the OnVisible property of the Make screen), check if the issue is solved.

     

    Best regards,

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @v-xida-msft 

     

    Thank you for your help but it didn't work. 

    new solution.jpg

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

    Hi @Anonymous ,

    Based on the screenshot that you provided, it seems that there is something issue with the isFolder column. Please check if there is a column called isFolder in your Tickets Excel table.

     

    If there is no column called isFolder in your Tickets Excel table, please remove the isFolder = true condition from your Filter formula.

     

    Note: Within your Filter function, the filtered column you referenced must be existed in your Tickets Excel table. You could not reference columns from another data source within the Filter function.

     

    Best regards,

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @v-xida-msft 

    Yes you where right I didn't have a column called isFolder. 

    I removed the isFolder=true from my code but it stil doesn't work. 

    Make tickets.jpg

     

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 July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 411 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 338

#3
WarrenBelz Profile Picture

WarrenBelz 256 Most Valuable Professional

Last 30 days Overall leaderboard