Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Power Query Editor Dynamic SharePoint Links

Hello, I currently have several files that link to a SharePoint to obtain their data, as shown in the screenshot the first line has the SharePoint link, and the other marked lines are the actual fil...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi Anonymous & serpiva64  - I would encourage you to simply the Power Query by introducing Table.SelectRows filter after the Source step using Text.Contains for the Folder Name filter.  This will make it easy to manage the parameters passed from outside the query.  The M advanced editor will look more like this.

    let
      Source = SharePoint.Files(#"SharePoint Site", [ApiVersion = 15]),
      Folder = Table.SelectRows(Source, each Text.Contains( [FolderPath] , #"SharePoint Folder") ),
      File = Table.SelectRows(File, each [FolderPath] = #"SharePoint File"),
      #"Open Excel" = Excel.Workbook( File{0}[Content] )
    in
      #"Open Excel"


    This should make it possible to pass parameters to update the SharePoint Site and Folder and