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”