
Originally Posted by
JEC.
The best way is to use Get Data --> From File --> From Sharepoint Folder
Furthermore, choosing the variable filename is possible while creating the query.
If you don't have this "From Sharepoint Folder" option, you could go for Get Data From Web. Use the sharepoint URL.
Not bound to a local path but not so easy to select the dynamic filename.
Hi JEC,
I get it mostly working via OneDrive with this query:
let
Source = Excel.Workbook(Web.Contents("https://domain-my.sharepoint.com/personal/user_domain/Documents/TfNSW/ValueCreationFramework-Calculator_v9.xlsm"), null, true),
#"Filtered Rows" = Table.SelectRows(Source, each [Kind] = "Sheet"),
#"Removed Other Columns" = Table.SelectColumns(#"Filtered Rows",{"Name"}),
#"Filtered Rows1" = Table.SelectRows(#"Removed Other Columns", each Text.StartsWith([Name], "Item ")),
#"Renamed Columns" = Table.RenameColumns(#"Filtered Rows1",{{"Name", "ItemsListPQOD"}})
in
#"Renamed Columns"
But, it fails when the filename is changed.
I do have a Sharepoint subscription... but not sure how to get the variable into the query:
let
Source = SharePoint.Files("https://domain-my.sharepoint.com/personal/user_domain/", [ApiVersion = 15]),
#"Filtered Rows" = Table.SelectRows(Source, each Text.Contains([Folder Path], "TfNSW") and Text.StartsWith([Name], "ValueCreationFramework-Calculator"))
in
#"Filtered Rows"
The last query only shows the various files, rather than the sheets in my file.
Bookmarks