Forum Discussion
kroman
1 year agoHelper II
Getting 'One or more table references a dynamic Data Source' even with Web.Contents with Relativepat
Hi All I have a simple query where trying to get a site url from one item in SP list and then get files list from that site, by following code: let
Source0 = Json.Document(Web.Contents("https:...
lbendlin
1 year agoSuper User
You're correct, I missed that line.
Can you please post the refactored code that uses SharePoint.List instead of the API call?
Power Query SharePoint list connector - Power Query | Microsoft Learn
kroman
1 year agoHelper II
let
Source0 = SharePoint.Tables("https://MyOrg.sharepoint.com/sites/DigitalWorkplaceReporting", [Implementation="2.0", ViewMode="All"]),
#"ffdf74ed-79dd-4c01-a2f3-14bead82700f" = Source0{[Id="ffdf74ed-79dd-4c01-a2f3-14bead82700f"]}[Items],
#"Filtered Rows" = Table.SelectRows(#"ffdf74ed-79dd-4c01-a2f3-14bead82700f", each ([StatusN] = 1)),
TheSite = Table.First(#"Filtered Rows")[SiteUrl],
Source = SharePoint.Files(TheSite, [ApiVersion = 15]),
#"Sorted rows" = Table.Sort(Source, {{"Date created", Order.Ascending}}),
#"Filtered rows" = Table.SelectRows(#"Sorted rows", each [Date modified] < #datetime(2017, 5, 1, 0, 0, 0)),
#"Sorted rows 1" = Table.Sort(#"Filtered rows", {{"Date modified", Order.Ascending}}),
#"Expanded Attributes" = Table.ExpandRecordColumn(#"Sorted rows 1", "Attributes", {"Size"}, {"Size"}),
#"Changed column type" = Table.TransformColumnTypes(#"Expanded Attributes", {{"Size", type number}}),
#"OldFiles" = Table.Sort(#"Changed column type", {{"Size", Order.Descending}}),
#"Removed Columns" = Table.RemoveColumns(OldFiles,{"Content"})
in
#"Removed Columns"