Forum Discussion

kroman's avatar
kroman
Helper II
1 year ago

Getting 'One or more table references a dynamic Data Source' even with Web.Contents with Relativepat

Hi All

I have a simple query where trying to get a site url from one item in SP list and then get files list from that site, by following code:

let
    Source0 = Json.Document(Web.Contents("https://MyOrg.sharepoint.com/sites/DigitalWorkplaceReporting/_api",
      [  
        RelativePath="web/lists/GetByTitle('SPSites8')/items",
        Query=[
          #"$top"="50", //This is the size of the batch
          #"$filter"="StatusN eq 1"
           ],
        Headers=[  Accept="application/json;odata=nometadata"   ]  //changing headers return a JSON Document
              
       ] 
     )
     ),
    value = Source0[value],
    value1 = value{0},
    TheSite = value1[SiteUrl],
  Source = SharePoint.Files(TheSite, [ApiVersion = 15]),
  #"Sorted rows" = Table.Sort(Source, {{"Date created", Order.Ascending}}),
  #"Filtered rows" = Table.SelectRows(#"Sorted rows", each [Date modified] < #datetime(2017, 5, 1, 0, 0, 0)),
  #"Sorted rows 1" = Table.Sort(#"Filtered rows", {{"Date modified", Order.Ascending}}),
  #"Expanded Attributes" = Table.ExpandRecordColumn(#"Sorted rows 1", "Attributes", {"Size"}, {"Size"}),
  #"Changed column type" = Table.TransformColumnTypes(#"Expanded Attributes", {{"Size", type number}}),
  #"OldFiles" = Table.Sort(#"Changed column type", {{"Size", Order.Descending}}),
  #"Removed Columns" = Table.RemoveColumns(OldFiles,{"Content"})
in
  #"Removed Columns"

but still getting 'One or more table references a dynamic Data Source' despite using Web.Contents with Relativepath option (which, lots of people claims, should resolve this issue)
Any idea why its happening? 

Thanks

11 Replies

  • No need to use Web.Contents for SharePoint lists.  Use the Standard SharePoint List connector.

    • kroman's avatar
      kroman
      Helper II

      And how is that supose to sort the problem?

      • lbendlin's avatar
        lbendlin
        Super User

        You will have a static Site URL  that will satisfy the "dynamic data source monster".  All the dynamic stuff can then happen as if you were using RelativePath.