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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
009co
Helper IV
Helper IV

SharePoint.Files vs SharePoint.Contents - shared folder auth works for Files but not Contents

I have been using SharePoint.Files to connect to another person's OneDrive which has folders shared with me uisng the following connection:

 

= SharePoint.Files("https://my_company.sharepoint.com/personal/other_person_name/", [ApiVersion = 15])

 

This works. I am able to authenticate and access only the shared folders using my credentials. I can see all of the folders shared with me and access their content.

 

However, when I tried using SharePoint.Contents to access the same shared OneDrive content, it doesn't accept the same authentication used for SharePoint.Files.


= SharePoint.Contents("https://my_company.sharepoint.com/personal/other_person_name/", [ApiVersion = 15])

 

Is this expected behavior? I expected that would be able to authenticate and see only the shared folders and be able to navigate to the folder I wanted and get content.

 

Ideas?

 

Edited to add:

I am using "Microsoft account" authentication in both connections.

1 ACCEPTED SOLUTION
009co
Helper IV
Helper IV

Changed API to 14 from 15 and then it authenticates!

 

= SharePoint.Contents("https://my_company.sharepoint.com/personal/other_person_name/", [ApiVersion = 14])

 

Hmm ... 

 

View solution in original post

4 REPLIES 4
mirmoazam
Frequent Visitor

This worked for me

joglidden2
Post Patron
Post Patron

PBI Team, please fix you SharePoint browser so we don't have to resort to these tricks. Don't get me wrong, love the job security, but this solution is about as sketchy as SharePoint is. PBI is better than that!

v-jingzhang
Community Support
Community Support

Hi @009co 

 

Not sure what is the specific difference between two API versions that could explain this problem. It seems switching to 14 can solve several problems with version 15. 

https://community.powerbi.com/t5/Issues/SharePoint-Folder-Connector-fails-for-API-15/idi-p/331819 

https://community.powerbi.com/t5/Issues/SharePoint-File-Retrieval-Limit/idi-p/307021 

 

Best Regards,
Community Support Team _ Jing

009co
Helper IV
Helper IV

Changed API to 14 from 15 and then it authenticates!

 

= SharePoint.Contents("https://my_company.sharepoint.com/personal/other_person_name/", [ApiVersion = 14])

 

Hmm ... 

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.