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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Connecting to SharePoint root site with Service

In a table, I am iterating over multiple Sharepoint sites. In PBI Desktop all works fine but since in Service I cannot connect to just the root SP site it seems.

 

I use the SP with relative path consisting of multiple variables:

 

let
Source = Xml.Tables(Web.Contents("https://nXXXXXr365.sharepoint.com/",[RelativePath="sites/"& Ubyggingsområde & "/ProjectRoom/" & Veistrekning & "/_api/Web/Lists(guid'" & GUID & "')/Items(" & Item & ")/Versions"])),
#"Expanded entry" = Table.ExpandTableColumn(Source, "entry", {"id", "category", "link", "title", "updated", "author", "content"}, {"id.1", "category", "link", "title.1", "updated.1", "author", "content"}),
#"Removed Columns" = Table.RemoveColumns(#"Expanded entry",{"title", "category", "title.1", "author", "link", "updated.1"})

 

 

In Power BI Service, 1 of the sources is then "https://nXXXXXr365.sharepoint.com/".

However, I cannot connect to this. I am getting an error saying the credentials are invalid.

Through my browser I have access and I checked the spelling of the URL and credentials.

 

The data source in service: https://1drv.ms/u/s!AvQWF2UlGbqT8jN3Bc_t_p9OMuR1

Error message saying invalid credentials while my credentials work in every other source/browser etc,: https://1drv.ms/u/s!AvQWF2UlGbqT8jSGrIj-UN5m076d

 

Is there a solution for connecting to the main site and iterating over multiple sites?

 

BTW, I used this method of collecting all XML files since connecting to version tables in a SharePoint list appearantly doesn't work.

I based this on among others these posts:

https://blog.crossjoin.co.uk/2016/08/16/using-the-relativepath-and-query-options-with-web-contents-i...

https://blog.crossjoin.co.uk/2016/08/23/web-contents-m-functions-and-dataset-refresh-errors-in-power...

http://blog.datainspirations.com/2018/02/17/dynamic-web-contents-and-power-bi-refresh-errors/

 

 

Thank you in advance

 

Status: New