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

Community site session details

Session Id : mGApD3Lo2fqohIzP92/H6+
Power Automate - Building Flows
Answered

Filtering Document Library

Like (0) ShareShare
ReportReport
Posted on 9 Jan 2023 12:18:05 by 117

Hi,

 

I have a document library that contains many files and I'm looking to filter this with an aim to export files alongside their metadata. Currently my plan is to use a Canvas Power App with around 10 fields, create a JSON object with the parameters then filter the SharePoint document library. Essentially I would iterate for each attribute in the object, collating the ID's into a variable, performing a union over that variable and then iterating through that list to prepare documents for download.

 

All in all, it's relatively simple however when it comes to filtering I have a problem. The list has a number of managed content fields and I can't just use a simple contains() or filterArray. Essentially I have the following:

 

"BusUnit": [
 {
 "@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedTaxonomy",
 "TermGuid": "07f487e6-b935-4b25-9443-7bbbb21f3b3a",
 "WssId": 52,
 "Label": "Preparedness",
 "Path": null,
 "Value": "Preparedness|07f487e6-b935-4b25-9443-7bbbb21f3b3a"
 },
 {
 "@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedTaxonomy",
 "TermGuid": "233b7369-3a94-4d90-ab4d-0ab3661ba20f",
 "WssId": 53,
 "Label": "Resilience",
 "Path": null,
 "Value": "Resilience|233b7369-3a94-4d90-ab4d-0ab3661ba20f"
 }
 ],

The 'BusUnit' is the field name, and I want to filter the list based on the items in this field. It's a multi-select so there could be a number of results.

 

Any ideas?

 

Thanks,

I have the same question (0)
  • v-xiaochen-msft Profile Picture
    on 10 Jan 2023 at 03:14:20
    Re: Filtering Document Library

    Hi @opticshrew2 ,

     

    You could try something like that

     

    Filter(YourDataSource,"Preparedness" in Concat(BusUnit,Label,";"))

     

    Best Regards,

    Wearsky

  • opticshrew2 Profile Picture
    117 on 10 Jan 2023 at 09:03:50
    Re: Filtering Document Library

    Hello! I have potentially 20+ options so hard-coding "Preparedness" probably wouldn't be an option. Also, as it's a Power Automate flow, unsure where I would apply that filter.

     

    I should say that I tried that in the Canvas Power App and it only worked if the records arrived in the same order as the filter, albeit using a "," instead of a ";"

  • Verified answer
    opticshrew2 Profile Picture
    117 on 16 Jan 2023 at 08:56:20
    Re: Filtering Document Library

    Standard filtering doesn't work in this case. I've gone back to the Power App and iterated through each combo box which provides a list of ID's per query. I then append these and remove duplicates whilst adding a column that counts how many instances there are. I can then filter where the number of instances equals the number of filter attributes.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 666 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 382 Moderator

#3
developerAJ Profile Picture

developerAJ 254

Last 30 days Overall leaderboard
Loading complete