cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sudosaurus
Post Prodigy
Post Prodigy

Display doc library folder that matches name of list item

Hello,

 

I have posted in another thread however had stopped getting responses and still need assistance with this if possible.

 

So the main SharePoint list has a column called "Contract Ref"
contractref.png

When an item is created, there is a Power Automate workflow that creates a folder in the "Contract Documents" document library named with the same value as the "Contract Ref" column in the list. The folder column is called "Name" (default).

contractdocs.png

 

Documents are manually added to this folder in the document library.

 

contractdocs1.png

 

So when I open the list item named "LWCM-09-06-2020-10", I am expecting these documents to display in the Power Apps form.

 

I have therefore changed the 'Items' code to the below however I am not seeing any files displayed in the form 

gallerycode.png
33 REPLIES 33
WarrenBelz
Super User
Super User

Hi @sudosaurus ,

How many documents are you likely to have? Neither Name nor 'Folder Path' are Delegable Filters.

I just did a test this end and got exactly the same result (valid formula with Delegation Warning, but blank gallery).

There is a workaround however, which I use on thousands of Documents. Put the Folder structure in metadata fields (one field for each level) and your queries will become delegable.

 

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.

HI @WarrenBelz , there could be several documents in each folder.

 

How would I go about the metadata option? Users will be uploading to these folders and we want to make it as easy as possible.

@sudosaurus 

 

I tried the same and it worked my Document Library named Account, the DataSource is Account but the library name in sharepoint is account

the Folder path however do not work with Account in Capital but it worked on account with small letters

Filter(Account,'Folder path'="account/yourFolderName"&"/")

 

Mira_Ghaly_0-1595325172744.png

 

My Library name in URL 

Mira_Ghaly_1-1595325215189.png

 

 

Please mark as accepted solution if this has fixed your problem

If this post helps you with your problem, please mark your as Accepted solution.If you like my response, please give it a Thumbs Up.

Blog: here

Hi @sudosaurus ,

You would do it in your Power Automate with "Update File Properties". Depending on your file structure, you can make this one folder (with the full path as a text string) or one field per folder level (as I do). You are already naming the folder/s, so you have this information available to the Flow.

If for instance you used one folder for the full path, you would use this text in your filter instead of the folder path as you do now with the difference being text filters are Delegable and you will get reliable results

As I mentioned smaller data sets may work, but you will always get a Delegation warning (as the post from @Mira_Ghaly also displayed one of these). My practice is to simply not work with these as you are never sure you are getting complete results., particularly as the data grows in size.

 

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.

@Mira_Ghaly I am not sure what I'm doing wrong?

 

Filter(Contract Documents,'Folder path'="Contract Documents"&"/")

 

Contract Documents in the document library name.

@sudosaurus

Folder path parameter should match your document library name as you see it in the URL when u navigate to the document library in sharepoint. 

If this post helps you with your problem, please mark your as Accepted solution.If you like my response, please give it a Thumbs Up.

Blog: here

@Mira_Ghaly 

This is my path: https://mysite.onmicrosoft.com/sites/ContractSupplierRegister/Contract%20Documents/Forms/AllItems.as...

Should I be typing Contract&20Documents ? As the folder consists of two words even though the display name is Contract Documents ?

@Mira_Ghaly 

 

This is my folder path URL:

 

https://domain.sharepoint.com/sites/ContractSupplierRegister/Contract%20Documents/Forms/AllItems.asp...

 

Contract%20Documents is the document library folder - does that mean I should use Contract%Documents or the Display Name "Contract Documents" ?

@sudosaurus

YesPlease try

ContractSupplierRegister/Contract%20Documents/

 

Or

 

Contract%20Documents/

If this post helps you with your problem, please mark your as Accepted solution.If you like my response, please give it a Thumbs Up.

Blog: here

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (1,765)