Sudden error when connecting to monday.com from power bi

Hello Guys,

I’m encountering an error just today when connecting to monday.com from power bi. The error is “Expression.Error: The field ‘data’ of the record wasn’t found.” See the code below:

let
Key = “my key”,
Board = “3722588315”,
Source = Web.Contents(
https://api.monday.com/v2”,
[
Headers=[
#“Method”=“POST”,
#“Content-Type”=“application/json”,
#“Authorization”=“Bearer " & Key
],
Content=Text.ToBinary(”{““query””: ““query { boards(ids: " & Board & “) { items { name, updated_at, group { title }, columns: column_values { title, text } } } }””}”)
]
),
Data = Table.FromList(Json.Document(Source)[data][boards]{0}[items], Record.FieldValues, {“Title”, “UpdatedAt”, “Group”, “Columns”}),
#“Trent700” = Table.FromRecords(Table.TransformRows(Data, each
List.Accumulate([Columns], [
Title = [Title],
UpdateDate = [UpdatedAt],
Group = [Group][title]
], (state, current) => Record.AddField(state, current[title], current[text]) )
)),
#“Renamed Columns” = Table.RenameColumns(Trent700,{{“Title”, “ESN”}}),
#“Filtered Rows” = Table.SelectRows(#“Renamed Columns”, each ([Group] = “Gate 1”)),
#“Filtered Rows2” = Table.SelectRows(#“Filtered Rows”, each [Actual Gate Closure Date] <> null and [Actual Gate Closure Date] <> “”),
#“Changed Type1” = Table.TransformColumnTypes(#“Filtered Rows2”,{{“Actual Gate Closure Date”, type date}})
in
#“Changed Type1”

Hello, i ve got the same problem, i had set of reports working fine and suddenly they stopped working. Returning same error. We made no changes to our data sets so im quite surprised to see this.
Is there any solution to this?

I’m new to a client and Monday.com API. We just had ours break as well using Power BI. I came to learn its because we were still targeting the 2023-07 API version. Your m-code looks to not be targeting an API version for starters.

But I believe the reason yours broke is you are still using items, it now must be items_page. This was a change going to the 2023-10 API version.

If you end up needing more than 100 records (i think thats the items limit) you will also need to bring in the cursor ability. If you can find my other posts/replies from recently. I have posted my fixes and findings the past few weeks working through my struggles on this in Power BI. I even got a looping function using the cursor. Now i’m stuck because I found out about BoardRelationValue for some linked boards used to selected some values on another Board and Monday changed something about not supporting those values within “text” column_values, so now I needed to add " … on BoardRelationValue { display_value}" into the column_values I’m bringing back.

I hope I didn’t miss anything because I only edited your code here and didn’t run anything. Try this:

let
Key = “my key”,
Board = “3722588315”,
Source = Web.Contents(
https://api.monday.com/v2”,
[
Headers=[
#“Method”=“POST”,
#“Content-Type”=“application/json”,
#“API-Version”=“2023-10”,
#“Authorization”=“Bearer " & Key
],
Content=Text.ToBinary(”{““query””: ““query { boards(ids: " & Board & “) { items_page { items { name, updated_at, group { title }, columns: column_values { title, text } } } } }””}”)
]
),
Data = Table.FromList(Json.Document(Source)[data][boards]{0}[items_page][items], Record.FieldValues, {“Title”, “UpdatedAt”, “Group”, “Columns”}),
#“Trent700” = Table.FromRecords(Table.TransformRows(Data, each
List.Accumulate([Columns], [
Title = [Title],
UpdateDate = [UpdatedAt],
Group = [Group][title]
], (state, current) => Record.AddField(state, current[title], current[text]) )
)),
#“Renamed Columns” = Table.RenameColumns(Trent700,{{“Title”, “ESN”}}),
#“Filtered Rows” = Table.SelectRows(#“Renamed Columns”, each ([Group] = “Gate 1”)),
#“Filtered Rows2” = Table.SelectRows(#“Filtered Rows”, each [Actual Gate Closure Date] <> null and [Actual Gate Closure Date] <> “”),
#“Changed Type1” = Table.TransformColumnTypes(#“Filtered Rows2”,{{“Actual Gate Closure Date”, type date}})
in
#“Changed Type1”