Forum Discussion

regerror6's avatar
regerror6
Frequent Visitor
4 years ago
Solved

How to exclude deleted SharePoint files

My data source is a SharePoint online library, and I am trying to figure out how to exclude deleted SharePoint files from the result set?  Here is an example source step:

 

= SharePoint.Files("https://examplecompany.sharepoint.com/sites/examplesite/", [ApiVersion = 15])

 

In other posts, the recommendation is to delete it from the SharePoint recycle bin (both first and second stage).  I deleted it from the first stage recycle bin, but I am not a site collection administrator to delete it from the second stage.  Plus, I do not think the library owners will remember to do this anyway (why should they?).  I am surprised a delete indicator is not included in the metadata.

 

On a weird note, it looks like Power Query is excluding it from the preview, but the deleted file reappears once it is applied to the report.

 

Has anyone found a way to achieve this?

  • It looks like this might have been a timing issue.  I refreshed the report while I was on the phone with MSFT (first time since yesterday), and the deleted file was gone.  I am not able to see the site collection (second stage) recycle bin, so I cannot see if it has also been purged from the site, too.  My understanding contents are automatically removed after 93 days unless someone manually removes them.  MSFT did not have any other insight, but I'll consider this resolved for now.

     

    If anyone has any other scenarios, let me know.  I am curious if other folks have issues with this.

3 Replies

    • regerror6's avatar
      regerror6
      Frequent Visitor

      Thanks for confirming the behavior, lbendlin!  I submitted a Pro ticket and will update this post if MSFT is able to provide any insight.

      • regerror6's avatar
        regerror6
        Frequent Visitor

        It looks like this might have been a timing issue.  I refreshed the report while I was on the phone with MSFT (first time since yesterday), and the deleted file was gone.  I am not able to see the site collection (second stage) recycle bin, so I cannot see if it has also been purged from the site, too.  My understanding contents are automatically removed after 93 days unless someone manually removes them.  MSFT did not have any other insight, but I'll consider this resolved for now.

         

        If anyone has any other scenarios, let me know.  I am curious if other folks have issues with this.