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
Super User II
Super User II

@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 III
Super User III

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

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (26,358)