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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Search or Filter multi...
Power Apps
Unanswered

Search or Filter multiple document libraries with one search bar?

(0) ShareShare
ReportReport
Posted on by 93

Hello, 

 

I am building a search app for a Sharepoint library. The library has about 10 different document library and in each library there are about 4-5 different Columns.  The goal of the project is to be able to simplify a users search process so there is only one text input. Lets say the wanted to search a job number but there are two different libraries that have a job number column, I would like the results to show all the documents with that have a matching result even if they are in different document libraries. Is there a way to do this?

Categories:
I have the same question (0)
  • AmirBakht Profile Picture
    262 on at

    First off, you need to take care of 2 things,

    • Read up on delegation to make sure what you are doing is delegable. You can find that information here https://docs.microsoft.com/en-us/connectors/sharepointonline. This is important because unless you delegate, it will retrieve all items and then look into them for your search criteria. This would be fine for a few records but there is a limit and performance to consider once the number of documents increase. So read up here first. 
    • Second you want to make sure the columns your criteria hits are indexed. This is again for when you have larger number of records

    You could add a text box and put the following logic on the On Change of the text box or on a button next to the text box,

    • ClearCollect(SearchResults, Filter(Library1, FilterCriteria), Filter(Library2, FilterCriteria), ....)
    • You could then use ShowColumns, AddColumns, RenameColumns and SortByColumns to organize your data
    • Use the SearchResults collection within a gallery to display the results

     

  • Jagadeeshk Profile Picture
    457 on at

    Try below, Let say search text name is searchtxtip

    Create one gallery for each library and assign items as filter( source, starts with( coloumn, seachtxtip.text)

  • Verified answer
    v-yutliu-msft Profile Picture
    on at

    Hi @Maxwell123 ,

    Do you want to filter two sharepoint libraries based on the same textinput?

    Whether do you want to display the result in two galleries or in one gallery?

    Could you tell me:

    1)the structure of these two libraries?

    2)which field do you want to filter based on that textinput? that field's data type?

    I assume that the field is text type.

     

    1)If you want to display the result in two galleries, you just need to insert one textinput, two galleries.

    set gallery1's Items:

    Filter(library1,Textinput1.Text in fieldname)

    set gallery2's Items:

     

    Filter(library2,Textinput1.Text in fieldname)

     

    2)If you want to display the result in one gallery, then you firstly need to merge these two libraries data to one collection, then filter based on that collection.

    Please notice that: one gallery could only has one data source, so you could not set the gallery's Items to two libraries.

    set the app's OnStart:

    ClearCollect(collection,library1,library2)

    set the gallery's Items:

    Filter(collection,Textinput1.Text in fieldname)

     

     

    Best regards,

  • Sidhant_02 Profile Picture
    986 on at

    Hi @v-yutliu-msft@Maxwell123 @Jagadeeshk @AmirBakht  ,
    I have a similar requirement wherein I want to list all the files in document libraries (which are in different sites) and the records/file details in one gallery. So I followed the steps
    that you have mentioned, but one issue is that the collection is only collecting all the details from one document library i.e. named Miscelaneous (in Pune Share Point Site) and the other document library is named 'TrialLibrary' which is in DEMO_PowerApps SharePoint site, which is:
    (I have attached the file structure in both the document library which are in different sites in the attachments section of this post and remaining are:)
    Miscelaneous1.pngMiscelaneous.png








    Sidhant_02_0-1697178554599.png

    So as you can see after merging both the document libraries in one collection in the Gallery it is only displaying one document library records (here Miscelaneous), but when I checked in the variable it has total count of 10

    Sidhant_02_1-1697178667293.png


    Could you please let me know merging records from two different document libraries is possible/not?. If yes (with collection) what's the issue here?.
    If anyone has any idea please do share.

    Regards,
    Sidhant.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard