Forum Discussion
Struggling using API bringing in subitems from Monday board using M
Thank you for the reply Xiaoxin,
I may have worded the question wrong, and even then, it may have changed.
Here is the M query we are using currently to bring in the subitems. I have contacted Monday.com and they were of assistance directing us how to access all subitems on a board, but I am running into limits on how much I can bring in at once.
(id_board as text) =>
let
Key = "Monday Key",
Source = Web.Contents("https://api.monday.com/",
[
RelativePath="v2",
Headers=[
#"Method"="POST",
#"Content-Type"="application/json",
#"Authorization"=
"Monday Key"
],
Content=Text.ToBinary("{""query"": ""{ boards(ids: 3305530367) { items (limit: 350, page: 1){ id subitems{name column_values{ title text }} } } }""}")
]
),
#"Json" = Json.Document(Source,65001),
data = Json[data],
boards = data[boards],
boards1 = boards{0},
items = boards1[items],
#"Converted to Table" = Table.FromList(items, Splitter.SplitByNothing(), null, null, ExtraValues.Error)
in
#"Converted to Table"
The bolded section is I believe the issue. That is the limit of subitem data that can come over after we invoke the subitem board id. If we set the number any higher then it give the error:
"An error occurred in the ‘’ query. Expression.Error: The field 'data' of the record wasn't found.
Details:
errors=[List]
extensions=[Record]
account_id=6018786"
How can I use M to break the data up to bring in multiple pages of subitem data and not be limited to the 350 max like I am right now?