cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
stujol80
Helper II
Helper II

intermittent failing expression

i have a powerapp form connected to a sharepoint site.

 

A button rums the below code and creates a collection of document names from a sharepoint site.

ClearCollect(colDocuments, Filter(Documents,'{Path}'="Shared Documents/SMR Documents/" & DataCardValue13.Text & "/",'{IsFolder}'=false));

 

DataCardValue13.Text changes from folder 01, folder 02 etc dependent on selected sharepoint record.

 

most times the expressions works and returns correctly, but sometimes it returns nothing for a specific folder, even though there are files in the folder. 

 

Can anyone offer any advice or fault finding tips?

 

 

6 REPLIES 6
poweractivate
Community Champion
Community Champion

@stujol80 

 

1) Try going here and refreshing the data source in the Power Apps Editor:

 

qkrefreshdatasource3927850.png

 

 

2) Even if #1 works - to try to do this in the App runtime instead of outside the App:

 

Try using Refresh() Function 

from somewhere in the App. Such as OnVisible of the screen. See if this works.

If this really works, put a button or icon in there that people using the App and press, and use the OnChange property of that Control, put this Refresh in there, so that it might work to solve this problem.

 

 

Check if any of the above help @stujol80 

stujol80
Helper II
Helper II

@poweractivate thanks for the quick response.

refreshing has no effect

 

if i run the expression for 'folder 1' = works correctly.
if i run the expression for 'folder 2' = works correctly.
if i run the expression for 'folder 3' = returns 0 files even though files are in the folder.
if i run the expression for 'folder 4' = works correctly.

if i run the expression for 'folder 5' = returns 0 files even though files are in the folder.

@stujol80 

 

This seems strange to us, we are curious to see if maybe someone else have some insight about it such as @v-xiaochen-msft @v-bofeng-msft @v-siky-msft or otherwise.

Any further thoughts on this issue? @v-xiaochen-msft @v-bofeng-msft @v-siky-msft @poweractivate 

HI @stujol80 ,

I suspect your problem is that '{Path}' is not Delegable, therefore you are only getting searching in the first 500-2000 (depending on your settings) files.

I have the same issue with large document libraries, but store the folder structure (one field for each level) in the Library item Metadata when the document is filed. So the Text fields can then be Filtered on any number of records.

If you have ever done SharePoint Workflows, this one is below, but I will be replacing it with Power Automate at some stage. If you have not, you need SharePoint Designer 2013.

FolderWorkflow.png

 

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.

WarrenBelz
Super User
Super User

Hi @stujol80 ,

Just checking if you got the result you were looking for on this thread. Happy to help further if not.

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.

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

secondImage

Power Apps Community Call

Please join us on Wednesday, October 20th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (2,364)