Forum Discussion

Shamatix's avatar
Shamatix
Icon for Post Partisan rankPost Partisan
6 years ago
Solved

We cannot apply field access to the type List.

Hi there fellow users of Power Bi,   We have now gotten a bit further and is now stumbling upon a new error: "We cannot apply field access to the type List." Below is our M code   let // F...
  • artemus's avatar
    artemus
    6 years ago

    In this case, it looks like it is trying to extract a list when it already got one. In that case try removing the final step in that function:

     

     GetPage = (Index) =>
            let     
                Skip  = "offset=" & Text.From(Index * EntitiesPerPage),
                Top   = "?count=" & Text.From(EntitiesPerPage),
                Url   = BaseUrl & Top & "&" & Skip,
                Json  = GetJsonList(Url)
            in  Json,

     

    if that doesn't work due to the file having both forms try:

     GetPage = (Index) =>
            let     
                Skip  = "offset=" & Text.From(Index * EntitiesPerPage),
                Top   = "?count=" & Text.From(EntitiesPerPage),
                Url   = BaseUrl & Top & "&" & Skip,
                Json  = GetJsonList(Url),
                Value = if Json is record then Json[#"value"] else else Json
            in  Value,