web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / intermittent failing e...
Power Apps
Unanswered

intermittent failing expression

(1) ShareShare
ReportReport
Posted on by Microsoft Employee

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?

 

 

Categories:
I have the same question (0)
  • poweractivate Profile Picture
    11,078 Most Valuable Professional on at

    @Anonymous 

     

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

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

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

  • poweractivate Profile Picture
    11,078 Most Valuable Professional on at

    @Anonymous 

     

    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.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

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

  • WarrenBelz Profile Picture
    155,374 Most Valuable Professional on at

    HI @Anonymous ,

    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 Profile Picture
    155,374 Most Valuable Professional on at

    Hi @Anonymous ,

    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.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 834

#2
Valantis Profile Picture

Valantis 533

#3
Haque Profile Picture

Haque 410

Last 30 days Overall leaderboard