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 / Searching a filtered g...
Power Apps
Answered

Searching a filtered gallery

(0) ShareShare
ReportReport
Posted on by 340

Hi guys,

 

I am wanting to add search capability to my gallery. My gallery displays the folders and files of a document library. I am wanting to filter based on the "Owner" field.

 

da1ve_0-1667947657379.png

 

The gallery items property is set to:

 

SortByColumns(
 Filter(
 'Processes',
 'Folder path' = varFolderPathCurrent
 ),
 "{IsFolder}",
 Descending,
 "{Name}",
 Ascending
)

 

I have tried adding the search context in the gallery items and also in a text input (TextInput16.Text), something like this:

 

Search(Filter('Processes', 'Folder path' = varFolderPathCurrent), TextInput16.Text, "Owner")

 

Not sure where I am going wrong, hopefully super simple

 

Thanks,
David

 

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    154,951 Most Valuable Professional on at

    Hi @da1ve ,

    Search and Filter do not always work well together and also neither 'Folder Path' nor Search (nor the code below) is Delegable

    Filter(
     'Processes', 
     'Folder path' = varFolderPathCurrent &&
     TextInput16.Text in Owner
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

  • da1ve Profile Picture
    340 on at

    Hi @WarrenBelz ,

     

    Thanks for your reply. I had similar results earlier and with your code it no longer displays the folders (just files). With your code as well as the below it drops off the folders (but search works).

     

    SortByColumns(
     Filter(
     'Processes', 
     'Folder path' = varFolderPathCurrent &&
     TextInput16.Text in Owner
    ),
     "{IsFolder}",
     Descending,
     "{Name}",
     Ascending
    )

      

    Is it possible to have search while preserving the folder view?

     

    There will never be thousands of records so delegation shouldn't be an issue

     

    Thanks,
    David

  • Verified answer
    WarrenBelz Profile Picture
    154,951 Most Valuable Professional on at

    HI @da1ve ,

    I will tell you how I have always dealt with Libraries due to the lack of Delegation (and subsequent issues with filters) and see if that suits you. I keep all relevant values in Text fields (including the name, folders and anything else relevant). I have Flows that take care of this when the file is created and also a SharePoint Integrated form to change anything. I have libraries over 100k records and have no issues with Delegation on any filters as a result. You could try to separate it a bit

    With(
     {
     wFiles:
     Filter(
     'Processes', 
     'Folder path' = varFolderPathCurrent &&
     TextInput16.Text in Owner
     )
     },
     SortByColumns(
     wFiles,
     "{IsFolder}",
     Descending,
     "{Name}",
     Ascending
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

  • da1ve Profile Picture
    340 on at

    @WarrenBelz ,

     

    Not working in my case - doesn't display anything

     

    da1ve_0-1667953059177.png


    Also worth mentioning I run an OnStart: Set(varFolderPathCurrent, "Processes/")

  • WarrenBelz Profile Picture
    154,951 Most Valuable Professional on at

    @da1ve ,

    I assume you picked up the extra bracket (not required) - now fixed.

  • da1ve Profile Picture
    340 on at

    I did thanks - still just shows files and no folders

  • da1ve Profile Picture
    340 on at

    @WarrenBelz 

    One other thing to mention, my folder\file label ahs a text property set to: ThisItem.'File name with extension'

    Not sure if that makes any sense why folders don't show?

  • WarrenBelz Profile Picture
    154,951 Most Valuable Professional on at

    @da1ve ,

    Yes - a Folder does not have a 'File name with extension', just a name.

  • da1ve Profile Picture
    340 on at

    @WarrenBelz 

     

    So if I remove the 

    &&
    TextInput16.Text in Owner

    It ends up like this:

    With(
     {
     wFiles:
     Filter(
     'Processes', 
     'Folder path' = varFolderPathCurrent
     )
     },
     SortByColumns(
     wFiles,
     "{IsFolder}",
     Descending,
     "{Name}",
     Ascending
     )
    )

     Then the folders and files show (even when the text label is "Name" or "File name with extension")

     

    So adding the && TextInput bit is messing with the folder view.

  • WarrenBelz Profile Picture
    154,951 Most Valuable Professional on at

    @da1ve ,

    One of the reasons I use all Metadata fields in Libraries (apart from Delegation issues) is just this - inconsistant results the more complex a filter gets. As logic would tell you, if the separate bits work, then it should work together (but it obviously does not). Have you considered what I posted ?

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 541

#2
WarrenBelz Profile Picture

WarrenBelz 434 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 289

Last 30 days Overall leaderboard