Skip to main content

I am experiencing an issue with a code that uses the Monday.com API to fetch data from a specific board. Below is the code I am using:


let

Source = Web.Contents(“https://api.monday.com/” & “v2”,

>

Headers=H

#“Method”=“POST”,

#“Content-Type”=“application/json”,

#“Authorization”=“Bearer Enter your API code”

],

Content=Text.ToBinary(“{”“query”“: “”{ boards(ids: rYOUR_BOARD_ID]) {items_page {items{column_values{ id value type } } } } }”“}”)

]

),

#“JSON” = Json.Document(Source,65001),

data = JSONdata],

boards = data1boards],

boards1 = boards{0},

items = boards1bitems],

#“Converted to Table” = Table.FromList(items, Splitter.SplitByNothing(), null, null, ExtraValues.Error),

#“Expanded Column1” = Table.ExpandRecordColumn(#“Converted to Table”, “Column1”, {“name”, “column_values”}, {“Column1.name”, “Column1.column_values”}),

#“Expanded Column1.column_values” = Table.ExpandListColumn(#“Expanded Column1”, “Column1.column_values”),

#“Expanded Column1.column_values1” = Table.ExpandRecordColumn(#“Expanded Column1.column_values”, “Column1.column_values”, {“title”, “text”}, {“Column1.column_values.title”, “Column1.column_values.text”}),

#“Changed Type” = Table.TransformColumnTypes(#“Expanded Column1.column_values1”,{{“Column1.column_values.title”, type text}}),

#“Pivoted Column” = Table.Pivot(#“Changed Type”, List.Distinct(#“Changed Type”,Column1.column_values.title]), “Column1.column_values.title”, “Column1.column_values.text”),

#“Renamed Columns” = Table.RenameColumns(#“Pivoted Column”,{{“Column1.name”, “Name”}})

in

#“Renamed Columns”


I believe the issue lies in the query I am using. When I attempt to run this code, I do not get the expected data, and I am unsure what is wrong with the query structure. Could you help me identify and resolve the problem?


Thank you in advance for your assistance !

Hello there @agustin.gomezdeltoro and welcome to the community!


I hope you like it here 💪


The code itself looks fine to me. I just tested this successfully:


{
boards(ids: 1234567890) {
items_page {
items {
column_values {
id
value
type
}
}
}
}
}

Are you entering your API token in the “Authorization” header and changing “YOUR_BOARD_ID” for your actual board ID?


What error are you seeing?


Looking forward to hearing from you 😀


Cheers,

Matias


Reply