Forum Discussion
Alternatives to dynamic data source
- 3 years ago
I was able to solve the problem. Here's the blog post that pointed me in the right direction: https://hoosierbi.com/2022/11/12/updated-get-sharepoint-list-data-fast/
Since all the project SharePoint sites have the same root site, I was actually able to use Web.Contents() and RelativePath to fetch the List contents. The one downside is that it doesn't come with the company's Active Directory data so that had to be retrieved separately, but that wasn't a big deal.
For future reference, here's the relevant part of the query:
= Table.AddColumn(#"Previous Step", "New Column Name", each Json.Document(Web.Contents("https://company.sharepoint.com/sites/projects/", [RelativePath = [TrimmedProjectUrl] & "/_api/web/lists/GetByTitle('ListName')/items", Headers = [Accept = "application/json"]])))
I was able to solve the problem. Here's the blog post that pointed me in the right direction: https://hoosierbi.com/2022/11/12/updated-get-sharepoint-list-data-fast/
Since all the project SharePoint sites have the same root site, I was actually able to use Web.Contents() and RelativePath to fetch the List contents. The one downside is that it doesn't come with the company's Active Directory data so that had to be retrieved separately, but that wasn't a big deal.
For future reference, here's the relevant part of the query:
= Table.AddColumn(#"Previous Step", "New Column Name", each Json.Document(Web.Contents("https://company.sharepoint.com/sites/projects/", [RelativePath = [TrimmedProjectUrl] & "/_api/web/lists/GetByTitle('ListName')/items", Headers = [Accept = "application/json"]])))