Forum Discussion

Richard_Halsall's avatar
2 years ago
Solved

Monday.com API and pagination

Hi,
 
Hoping somebody can help as I am sruggling with the Monday.com API and pagination. After research I have 2 queries 
 
GetBoardPages:
(PageNo as number) =>
let
    Key = MondayKey,
    Board = id_board,
    Source = Web.Contents(
MondayBaseURL,
 
[ RelativePath = "v2",
Headers=[
#"Method"="POST",
#"Content-Type"="application/json",
#"Authorization"="Bearer " & Key
],
Content=Text.ToBinary("{""query"": ""query { boards(ids: " & Board & ") { items (limit:10, page: Number.ToText (PageNo)) { name, updated_at, group { title }, columns: column_values { title, text } } } }""}")
]
    )
in
Source
 
Query 2:
let 
    Records = List.Generate(()=> 
            [Source = GetBoardPages(1), Page=1],
            each List.Count([Source][Monday]) > 0,
            each [Source = GetBoardPages([Page]+1), Page=[Page] +1],
            each [Source])
in
    Records
 
But Query 2 errors I believe at the List.Count line as follows:
 
Expression.Error: We cannot apply field access to the type Binary.
Details:
    Value=[Binary]
    Key=Monday
 
Can anybody help. Many thanks

1 Reply