Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Rihran
New Member

The SharePoint connector is not retrieving all files.

Hi everyone, I'm having trouble retrieving all the XML files from a folder shared with me. This folder has over 12,000 files, and it was working fine until, at a certain point, it stopped returning files that are present in the shared folder.

It's a shared OneDrive folder; I'm using the following connector.
SharePoint.Files("https://minhaempresa-my.sharepoint.com/personal/usuario_origem_com_br", [ApiVersion = 15])

I already tried changing the API to version 14 and no data was returned. I removed the API version and still no data. I already tried using sharepoint.contents and still no data.

Please, I need help on how to resolve this issue.

1 ACCEPTED SOLUTION
v-pnaroju-msft
Community Support
Community Support

Hi Rihran,

Thankyou for the followup.

Based on my understanding, the issue may arise because the shared OneDrive folder contains over 12,000 XML files, which exceeds SharePoint Online’s List View Threshold of 5,000 items. This can lead to incomplete or empty results when Power Query attempts to enumerate the folder contents. Additionally, if you have been granted access only to the specific shared folder and not to the parent Documents library or site, Power Query cannot list the library root. As a result, SharePoint.Contents returns no data. SharePoint throttling and permission rules prohibit this type of enumeration without library level access.

To resolve this, a feasible approach is to request the folder owner to grant you Read permission at the Documents library or site, so Power Query can navigate the structure properly. Then, organise the XML files into subfolders containing fewer than 5,000 items each, which is a supported method for reliable querying of large document libraries.

After restructuring, reconnect using SharePoint.Contents with ApiVersion = 15 for performant folder level navigation in SharePoint Online.

If you still experience intermittent empty results after reducing folder sizes and correcting permissions, the behavior may be due to temporary SharePoint throttling and will require a retry or backoff. In that case, or if the issue persists after applying the above steps, please open a Microsoft Support ticket for deeper tenant level analysis using the link:Microsoft Fabric Support and Status | Microsoft Fabric

Additionally, kindly refer to the links below:
The number of items in this list exceeds the list view threshold - SharePoint | Microsoft Learn
Overview of large lists and libraries - Microsoft Support
Avoid getting throttled or blocked in SharePoint Online | Microsoft Learn
SharePoint.Contents - PowerQuery M | Microsoft Learn

We hope the information provided helps to resolve the issue. Should you have any further queries, please feel free to contact the Microsoft Fabric community.

Thank you.

View solution in original post

5 REPLIES 5
v-pnaroju-msft
Community Support
Community Support

Hi Rihran,

We are following up to see if what we shared solved your issue. If you need more support, please reach out to the Microsoft Fabric community.

Thank you.

v-pnaroju-msft
Community Support
Community Support

Hi Rihran,

We would like to follow up and see whether the details we shared have resolved your problem. If you need any more assistance, please feel free to connect with the Microsoft Fabric community.

Thank you.

v-pnaroju-msft
Community Support
Community Support

Hi Rihran,

Thankyou for the followup.

Based on my understanding, the issue may arise because the shared OneDrive folder contains over 12,000 XML files, which exceeds SharePoint Online’s List View Threshold of 5,000 items. This can lead to incomplete or empty results when Power Query attempts to enumerate the folder contents. Additionally, if you have been granted access only to the specific shared folder and not to the parent Documents library or site, Power Query cannot list the library root. As a result, SharePoint.Contents returns no data. SharePoint throttling and permission rules prohibit this type of enumeration without library level access.

To resolve this, a feasible approach is to request the folder owner to grant you Read permission at the Documents library or site, so Power Query can navigate the structure properly. Then, organise the XML files into subfolders containing fewer than 5,000 items each, which is a supported method for reliable querying of large document libraries.

After restructuring, reconnect using SharePoint.Contents with ApiVersion = 15 for performant folder level navigation in SharePoint Online.

If you still experience intermittent empty results after reducing folder sizes and correcting permissions, the behavior may be due to temporary SharePoint throttling and will require a retry or backoff. In that case, or if the issue persists after applying the above steps, please open a Microsoft Support ticket for deeper tenant level analysis using the link:Microsoft Fabric Support and Status | Microsoft Fabric

Additionally, kindly refer to the links below:
The number of items in this list exceeds the list view threshold - SharePoint | Microsoft Learn
Overview of large lists and libraries - Microsoft Support
Avoid getting throttled or blocked in SharePoint Online | Microsoft Learn
SharePoint.Contents - PowerQuery M | Microsoft Learn

We hope the information provided helps to resolve the issue. Should you have any further queries, please feel free to contact the Microsoft Fabric community.

Thank you.

Ritaf1983
Super User
Super User

Hi @Rihran 

The issue you're encountering is likely caused by the SharePoint View Threshold limit (5,000 items). Since SharePoint.Files attempts to scan all files in the entire Site/OneDrive before filtering, it often fails or returns incomplete results once a folder exceeds this limit.

To bypass this, you should use SharePoint.Contents with a direct navigation approach. This method functions like a file explorer, loading only the content of the specific folder rather than scanning the entire library.

Try replacing your query with this structure:

let
Source = SharePoint.Contents("https://minhaempresa-my.sharepoint.com/personal/usuario_origem_com_br"),
// Navigate through the folders step-by-step
Documents = Source{[Name="Documents"]}[Content],
TargetFolder = Documents{[Name="YourFolderName"]}[Content],
FilteredFiles = Table.SelectRows(TargetFolder, each ([Extension] = ".xml"))
in
FilteredFiles
Note: If navigating directly via SharePoint.Contents does not resolve the issue, it may be a deeper API throttling or permission sync problem. In that case, I recommend opening a formal support ticket with Microsoft/IT services to investigate the backend logs for your shared folder.

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Thank you for your suggestion, unfortunately it didn't work, sharepoint.contents doesn't return any data.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.