Hello,
I've pasted as below, i've removed the name of our Sharepoint from the Source line for security but the rest is as it appears.
let
Source = SharePoint.Files("removed", [ApiVersion = 15]),
#"Filtered rows" = Table.SelectRows(Source, each Text.Contains([Folder Path], "08 - WSP")),
#"Sorted rows" = Table.Sort(#"Filtered rows", {{"Date modified", Order.Descending}}),
#"Kept top rows" = Table.FirstN(#"Sorted rows", 1),
#"Filtered hidden files" = Table.SelectRows(#"Kept top rows", each [Attributes]?[Hidden]? <> true),
#"Invoke custom function" = Table.AddColumn(#"Filtered hidden files", "Transform file", each #"Transform file"([Content])),
#"Renamed columns" = Table.RenameColumns(#"Invoke custom function", {{"Name", "Source.Name"}}),
#"Removed other columns" = Table.SelectColumns(#"Renamed columns", {"Source.Name", "Date modified", "Transform file"}),
#"Expanded table column" = Table.ExpandTableColumn(#"Removed other columns", "Transform file", Table.ColumnNames(#"Transform file"(#"Sample file"))),
#"Transform columns" = Table.TransformColumnTypes(#"Expanded table column", {{"Order", type text}, {"Service Partner", type text}, {"Service product", type text}, {"P", type text}, {"System status", type text}, {"Sett Rec", type text}, {"Release", type text}, {"Req End", type text}, {"Service Type", type text}, {"Emergency", type text}, {"Cost Type", type text}, {"Description", type text}, {"Sub Description", type text}, {"OpAc", type text}, {"Op User Status", type text}, {"User Status", type text}, {"Postl Code", type text}, {"Teco", type text}, {"WB Workable", type text}}),
#"Replace errors" = Table.ReplaceErrorValues(#"Transform columns", {{"Order", null}, {"Service Partner", null}, {"Service product", null}, {"P", null}, {"System status", null}, {"Sett Rec", null}, {"Release", null}, {"Req End", null}, {"Service Type", null}, {"Emergency", null}, {"Cost Type", null}, {"Description", null}, {"Sub Description", null}, {"OpAc", null}, {"Op User Status", null}, {"User Status", null}, {"Postl Code", null}, {"Teco", null}, {"WB Workable", null}})
in
#"Replace errors"