Forum Discussion

collinq's avatar
collinq
Super User
5 years ago
Solved

SharePoint List - Getting ALL the data from ALL the specific lists in the Site

I don't think this should be as hard as I have made this on myself and so I am reaching out hree.  I have a SharePoint Site with the same list on many different sub-sites.  I have created a list of the URL's that I am trying to reach.   I just have confused myself too much with the Power QUery input to get this right.

 

I have my List as such:

https://sharepoint.com/sites/PWA/A
https://sharepoint.com/sites/PWA/B
https://sharepoint.com/sites/PWA/C
https://sharepoint.com/sites/PWA/D

 

So, in a new query I am trying to use that.  I have this:

let
Source = SharePoint.Tables("https://sharepoint.com/sites/" 

AND then, I can't get the syntax to work where it scrolls through A, then B, then C, etc.

 

Thanks for your help!

  • Hi collinq ,

     

    You need to create the function based on the sharepoint list then you need to create a source that is a list of values with the url then run the function on that code something like this:

     

    let
        Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WyigpKSi20tcvzkgsSi3Iz8wr0UvOz9UvzixJLdZXio0FAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Site = _t]),
        #"Changed Type" = Table.TransformColumnTypes(Source,{{"Site", type text}}),
        #"Added Custom" = Table.AddColumn(#"Changed Type", "Page", each {"A", "B", "C"}),
        #"Expanded Page" = Table.ExpandListColumn(#"Added Custom", "Page"),
        #"Added Custom1" = Table.AddColumn(#"Expanded Page", "ListURL", each [Site]&[Page])
    in
        #"Added Custom1"

     

    then run the custom function based on the ListURL column

     

     

3 Replies

  • Hi collinq ,

     

    Have you tried to create a function from one of the list with all the steps you need for transformation and then make a list with the A, b , c and link that with the "https://sharepoint.com/sites/" and use the function to merge all the values?

      • MFelix's avatar
        MFelix
        Super User

        Hi collinq ,

         

        You need to create the function based on the sharepoint list then you need to create a source that is a list of values with the url then run the function on that code something like this:

         

        let
            Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WyigpKSi20tcvzkgsSi3Iz8wr0UvOz9UvzixJLdZXio0FAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Site = _t]),
            #"Changed Type" = Table.TransformColumnTypes(Source,{{"Site", type text}}),
            #"Added Custom" = Table.AddColumn(#"Changed Type", "Page", each {"A", "B", "C"}),
            #"Expanded Page" = Table.ExpandListColumn(#"Added Custom", "Page"),
            #"Added Custom1" = Table.AddColumn(#"Expanded Page", "ListURL", each [Site]&[Page])
        in
            #"Added Custom1"

         

        then run the custom function based on the ListURL column