Power Query is often used to refresh and shape data from SharePoint document libraries in Excel and Power BI. A common problem arises when new files or folders are added to a SharePoint library, yet Power Query does not detect them after a refresh. The result is incomplete datasets, outdated reports, and confusing refresh behavior where older items continue to appear but the newest content is missing.
This article explains why the issue occurs, outlines the most effective troubleshooting steps, and provides practical query patterns to improve reliability. The focus is on SharePoint connectors and the behavior of Power Queryโs caching and metadata discovery, which can prevent newly created items from appearing immediately.
Why Power Query Sometimes Does Not See New SharePoint Items
The most frequent cause is a combination of caching and connector visibility limitations. Power Query can store metadata about a SharePoint source, such as previously discovered folder structures and item listings. When files or folders are added later, the cached snapshot may remain in effect until the connection state is cleared or a different connector approach is used.
In particular, the SharePoint.Files connector may not reliably surface items created moments earlier, especially in large libraries or complex folder hierarchies. Another factor is permissions and authentication state. If access tokens or the data source connection permissions are not refreshed properly, SharePoint content may appear inconsistent to Power Query.
Recommended Fixes in Order of Effectiveness
Several remedies are commonly effective. The steps below are arranged so the easiest and most impactful solutions occur first.
1. Clear the Power Query Cache and Reconnect Permissions
Clearing the cache is frequently the quickest way to force Power Query to re-evaluate the SharePoint folder listing.
- Excel (Power Query): Go to File โ Options and Settings โ Options โ Global โ Data Cache Management Options โ Clear Cache.
- Re-authenticate permissions: In Power Query, open Data โ Get Data โ Data Source Settings. Select the SharePoint connection and choose Clear Permissions. Then reconnect and refresh.
It is important to note that this behavior can recur, meaning the same process may need to be repeated after future library updates if Microsoftโs caching behavior does not automatically update item listings.
2. Use SharePoint.Contents Instead of SharePoint.Files
When new folders and files are missing, switching connectors can help. The SharePoint.Files connector may scan broadly and still miss the most recent changes. The SharePoint.Contents connector can be more targeted and can produce more predictable results when paired with structured navigation.
In the Power Query Editor:
- Select Home โ Advanced Editor.
- Replace the SharePoint.Files source with a SharePoint.Contents source.
Example connector pattern:
SharePoint.Files (typical form):
SharePoint.Files(“https://yourcompany.sharepoint.com/sites/yoursite”)
Switch to SharePoint.Contents (example form):
SharePoint.Contents(“https://yourcompany.sharepoint.com/sites/yoursite”, [ApiVersion = 15])
After changing the source, navigate through the returned hierarchy using the Content column to reach the relevant document library and folder path (for example, Shared Documents and the desired subfolders).
3. Connect Using the SharePoint Site Root URL
Another frequent pitfall is connecting at an overly specific folder URL. Power Query may treat certain folder URLs differently, and metadata discovery can be less consistent if the connection starts deep in the folder structure.
For better reliability:
- Use a connection at the site root, such as https://yourcompany.sharepoint.com/sites/yoursite.
- Avoid connecting directly to deep library folder paths like https://yourcompany.sharepoint.com/sites/yoursite/Shared Documents/Folder/Subfolder.
Then filter down to the target folder within Power Query. This approach often reduces the chance of missing newly added items in nested structures.
4. Refresh Manually and Validate Library Context
Once changes are made, Power Query should be refreshed manually to validate that the new items appear. Also confirm that the query is pointing to the correct document library and folder.
- Confirm the correct library: โShared Documentsโ versus a custom library name can affect results.
- Check folder filters: Any existing filters based on path, folder name, or file extension might exclude new files.
- Verify moved files: If files were moved after creation, path-based filters may need updates.
5. If Needed, Start a Fresh Query (Bypass Stuck States)
If clearing cache and switching connectors does not resolve the issue, a complete reset can be effective. Creating a new query from scratch bypasses any stuck cached states tied to the old query definition.
Typical โnuclearโ approach:
- Choose Get Data โ SharePoint Folder.
- Enter only the site root URL.
- Navigate through the folder tree again and select the intended library and folder.
- Close and load, then refresh.
Quick Troubleshooting Checklist
- Cache issue: Clear the Power Query cache and reconnect permissions.
- Connector mismatch: Prefer SharePoint.Contents over SharePoint.Files.
- URL depth: Connect at the site root and filter down.
- Permissions or authentication: Clear permissions and re-authenticate.
- Path-based filters: Confirm filters still match new folder structures and file paths.
Conclusion
Missing new SharePoint files and folders in Power Query is usually driven by caching behavior and connector-specific listing limitations. Clearing the cache and refreshing permissions is often the fastest solution, while switching from SharePoint.Files to SharePoint.Contents, connecting from the site root, and rebuilding the query when necessary can improve accuracy and reduce delays. Applying these practices helps ensure Power Query reflects the latest SharePoint library content after refresh.

Leave a Reply