Forum Discussion

OKgo's avatar
OKgo
Icon for Helper IV rankHelper IV
5 years ago
Solved

Lean M for SharePoint connector to folders

I have a table on Excel user interface that contains folders / parameters / variables. This query: let #"Source from Table Range" = Excel.CurrentWorkbook(){[Name="ParameterTable"]}[Content], ...
  • Jimmy801's avatar
    5 years ago

    Hello

     

    Yes, just add a new column in the Exceltable called Typ. Input Folder or Sharepoint. In M-language you can refer now to this new column with an if-statement like if [Type] = "Folder" then Folder.Files... else Sharepoint....

     

    If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
    Kudoes are nice too

    Have fun

    Jimmy

  • OKgo's avatar
    OKgo
    5 years ago

    Thank you Jimmy801  - that makes sense for the Excel table UI

     

    Using Sharepoint.Contents I can navigate to the correct folder. However that creates many steps which would be annoying (or non value adding) to feedback into the Excel UI. Maybe I will just live with the hardcoding as it does solve the problem of not being user specific which is an improvement to C:\

     

    let
    Source = SharePoint.Contents("https://company123.sharepoint.com/SharePointSite/", [ApiVersion = 15]),
    Project1 = Source{[Name="Project1"]}[Content],
    Folder2 = Project1 [Name="_Study_Specific"]}[Content],
    Customer3= Folder2 {[Name="Customer3"]}[Content],
    Account4 = Customer3{[Name="Account4"]}[Content],
    in
    Account4