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

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

@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 III
Helper III

@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
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.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (1,690)