cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
pheil
Level: Powered On

Gallery to show files only in specific Sharepoint subdirectory

How can I get the BrowseGallery items to only display files from a specific subdirectory.  I'm getting delegation issues even though I know the exact subdirectory name and each subdirectory only has maybe 20 files max.  It seems like I could use Flow, but hopefully that isn't necessary.

 

The SharePoint source has over 800 folders, but I don't ever need to see them since I always know the subdirectory I want.

 

I was using this, but it stopped working after I loaded more folders into the document library.  "EWSInput.Text" is the subfolder name I will always have.

 

SortByColumns(Search(Filter(EWS, '{Path}'="EWS/" & EWSInput.Text & "/"), TextSearchBox1.Text, "{FilenameWithExtension}"), "Modified", If(SortDescending1, Descending, Ascending))
2 REPLIES 2
Super User
Super User

Re: Gallery to show files only in specific Sharepoint subdirectory

Hi @pheil,

Search() is not delegatable in Sharepoint and will always trigger a warning.  To avoid that, use Filter(datasource, StartsWith(ColumnNameControl.Value)) instead.  In your case SortByColumns (Filter(EWS, StartsWith('{Path}'="EWS/" & EWSInput.Text & "/",TextSearchBox1.Text)) ,"{FilenameWithExtension}"), "Modified", If(SortDescending1, Descending, Ascending))

For a full understanding of delegation in Powerapps and what functions are delegatable please review 

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/delegation-overview and 

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/delegation-list

pheil
Level: Powered On

Re: Gallery to show files only in specific Sharepoint subdirectory

Drrickryp Thank for the response.  I tried your suggetion after removing one duplicate parentheses, but I get the error in the attached image.  I also tried tweaking the StartsWith formula without luck.

 

SortByColumns(Filter(EWS, StartsWith('{Path}'="EWS/" & EWSInput.Text & "/",TextSearchBox1.Text)) ,"{FilenameWithExtension}", "Modified", If(SortDescending1, Descending, Ascending))

Untitled.png