Forum Discussion
File on ShP site as a data source
Hi Anonymous ,
In Power Query, use the SharePoint Folder connector. The URL to enter will be something like this:
https://orgname.sharepoint.com/sites/sitename
You can get this URL easily enough by just navigating to the Home page of your SharePoint site and copying the URL from the browser.
It's best to start at this highest level as you then get a table with every file within the site that you can potentially import, and you also only have to store this high-level authentication on your gateway, making reusing the connection for other files in other folders much easier in future.
Pete
- Anonymous3 years agoNot applicable
Thank you for your reply. I tried this method, but unfortunately, I got the following error:
Could you please advise?
- BA_Pete3 years agoSuper User
It looks like you're trying to use the Web.Contents connector to access SharePoint, which is probably why you're getting a 405 error (due to insufficient permissions to access SharePoint via the Web.Contents connector).
As per my previous post, you should be using the SharePoint Folder connector with appropriate authentication. It will generate Source code something like this:
let Source = SharePoint.Files( "https://YourOrgName.sharepoint.com/sites/YourSiteName", [ApiVersion = 15] ) in SourcePete
- Anonymous3 years agoNot applicable
Last time I used Sharepoint Folder connector. Today I tried differently just with a new query and I still got 405 error:
I am wondering - the link to this SharePoint site looks a bit different as it includes "teams" not "sites". It seems that the file was loaded to ShP via Teams group. Does it make any difference? I'm not a member of this Teams group.
I also tried to use this method for other ShP site, but instead of the content of one of the files loaded there (which is my goal), I just got a list of all files.
Am I doing something wrong?