Forum Discussion
Loading multiple SharePoint page libraries into the same query
- 4 years ago
Try this solution. The concept is to create a URL table with a row for each library, and create a custom function that will loop through each library.
https://www.howtoexcel.org/how-to-extract-data-from-multiple-webpages/
- 4 years ago
Try using Web.Contents as suggested by KNP:
let GetResults=(URL) => let Source = Web.Page(Web.Contents(URL)), Data1 = Source{1}[Data] in Data1 in GetResultsIf this doesn't work, try Source{0} instead of Source{1}.
Thanks KNP & DataInsights, removing the ""s worked for me 🙂
KNP : I did have an issue when I went to set a scheduled refresh on this report after I published it:
So I'm going back to remove the reference in the blue box as you suggested:
let GetResults=(URL) =>
let
Source = SharePoint.Tables(URL, [Implementation="2.0", ViewMode="All"])
in
#"793529eb-48c3-4fad-a005-7a4aa0a716ad"
in GetResults
But its now giving me this error:
So I tried to go back and modify the code again, and I'm getting another error. Would you have any idea how I might fix this? I'm starting to dig myself a hole 😄
Try
let GetResults=(URL) =>
let
Source = SharePoint.Tables(URL, [Implementation="2.0", ViewMode="All"])
in
Source
in GetResults
But I don't think that is your issue now.
The 'Dynamic data source' error is one I'm not sure you'll be able to solve with the SharePoint.Tables connector. I've not needed to solve this problem myself so far so I haven't spent enough time on it to know if there are any workarounds. The workaround for other connectors exist i.e. Web.Contents using [RelativePath] but I'm not sure how easy this would be to incorporate into this example.
Maybe DataInsights may have some more ideas in this space.
- DataInsights4 years agoSuper User
Try using Web.Contents as suggested by KNP:
let GetResults=(URL) => let Source = Web.Page(Web.Contents(URL)), Data1 = Source{1}[Data] in Data1 in GetResultsIf this doesn't work, try Source{0} instead of Source{1}.
- MichaelHutchens4 years agoHelper V
Thanks so much DataInsights & KNP for your time with this, I really appreciate it 🙂