Forum Discussion

mopetkewi's avatar
mopetkewi
Frequent Visitor
1 month ago
Solved

using sharepoint.contents

When trying to use sharepoint.contents to open a sharepoint folder in power query, we notice that for some users excel files are not recognized when we drill to the folder.  But if we change mcode to...
  • ShivekMaharaj's avatar
    1 month ago

    Hi mopetkewi​,

     

    Since SharePoint.Files is returning the workbooks correctly, I would avoid changing the downstream Excel logic for now and test the SharePoint.Contents source itself.

     

    One option that may be worth trying is the newer connector implementation:

    SharePoint.Contents("https://tenant.sharepoint.com/sites/site", [ApiVersion = 15, Implementation = "2.0"])

    Microsoft documents both ApiVersion and Implementation = "2.0" as supported options for SharePoint.Contents. The latter switches the call to the newer SharePoint connector implementation.

     

    I would compare this on one machine where the files appear and one where they do not. If the same site URL and credentials are being used but the result differs between students, I would also clear the SharePoint data source permissions in Power Query and reconnect with the same Organizational Account before testing again.

     

    Since SharePoint.Files already sees the files, this looks more like an enumeration/navigation issue with SharePoint.Contents than an issue with the Excel files themselves.

    AI-assisted drafting: AI was used to help structure and phrase this response. I reviewed and validated the technical content before posting.