I’m striving to retrieve the corresponding boardId of a mirrored column when multiple boards and items are connected.
The query I use is:
{
boards(ids: 3184598220) {
columns {
id
title
type
settings_str
}
items(ids: 3184598225) {
created_at
email
group {
id
title
}
parent_item {
id
}
subitems {
id
}
column_values {
id
type
text
value
additional_info
}
}
}
}
I know I need to cycle multiple times thru board.columns
and board.items.column_values
properties.
{
"data": {
"boards": [
{
"columns": [
{
"id": "name",
"title": "Name",
"type": "name",
"settings_str": "{}"
},
{
"id": "person",
"title": "Person",
"type": "multiple-person",
"settings_str": "{}"
},
{
"id": "status",
"title": "Status",
"type": "color",
"settings_str": "{\"labels\":{\"0\":\"Working on it\",\"1\":\"Done\",\"2\":\"Stuck\"},\"labels_positions_v2\":{\"0\":0,\"1\":2,\"2\":1,\"5\":3},\"labels_colors\":{\"0\":{\"color\":\"#fdab3d\",\"border\":\"#E99729\",\"var_name\":\"orange\"},\"1\":{\"color\":\"#00c875\",\"border\":\"#00B461\",\"var_name\":\"green-shadow\"},\"2\":{\"color\":\"#e2445c\",\"border\":\"#CE3048\",\"var_name\":\"red-shadow\"}}}"
},
{
"id": "date4",
"title": "Date",
"type": "date",
"settings_str": "{}"
},
{
"id": "connect_boards",
"title": "Connect boards",
"type": "board-relation",
"settings_str": "{\"allowCreateReflectionColumn\":false,\"boardIds\":[3184597770,3184598094]}"
},
{
"id": "mirror",
"title": "Mirror",
"type": "lookup",
"settings_str": "{\"relation_column\":{\"connect_boards\":true},\"displayed_column\":{\"status\":true},\"displayed_linked_columns\":{\"3184597770\":[\"status\"],\"3184598094\":[\"status\"]}}"
}
],
"items": [
{
"created_at": "2022-09-04T13:59:44Z",
"email": "pulse-3184598225@xxx.monday.com",
"group": {
"id": "topics",
"title": "Group Title"
},
"parent_item": null,
"subitems": null,
"column_values": [
{
"id": "person",
"type": "multiple-person",
"text": "",
"value": null,
"additional_info": null
},
{
"id": "status",
"type": "color",
"text": "Working on it",
"value": "{\"index\":0,\"post_id\":null,\"changed_at\":\"2019-03-01T17:24:57.321Z\"}",
"additional_info": "{\"label\":\"Working on it\",\"color\":\"#fdab3d\",\"changed_at\":\"2019-03-01T17:24:57.321Z\"}"
},
{
"id": "date4",
"type": "date",
"text": "2022-09-04",
"value": "{\"date\":\"2022-09-04\",\"icon\":null,\"changed_at\":\"2022-09-04T13:59:45.001Z\"}",
"additional_info": null
},
{
"id": "connect_boards",
"type": "board-relation",
"text": "Item 1, Item 2, Item 3, Item 4, Item 3",
"value": "{\"linkedPulseIds\":[{\"linkedPulseId\":3184597779},{\"linkedPulseId\":3184597784},{\"linkedPulseId\":3184597788},{\"linkedPulseId\":3184598104},{\"linkedPulseId\":3184598103}]}",
"additional_info": null
},
{
"id": "mirror",
"type": "lookup",
"text": "Working on it, Done",
"value": null,
"additional_info": null
}
]
}
]
}
]
},
"account_id": 12345
}
From the board.columns
property I get the board ids and the column types.
{
"id": "mirror",
"title": "Mirror",
"type": "lookup",
"settings_str": "{\"relation_column\":{\"connect_boards\":true},\"displayed_column\":{\"status\":true},\"displayed_linked_columns\":{\"3184597770\":[\"status\"],\"3184598094\":[\"status\"]}}"
}
Matching the board relation in board.columns
with the id in board.items.column_values
, I get the corresponding item ids contained in the linkedPulseIds
property.
{
"id": "connect_boards",
"title": "Connect boards",
"type": "board-relation",
"settings_str": "{\"allowCreateReflectionColumn\":false,\"boardIds\":[3184597770,3184598094]}"
},
The problem is that the linkedPulseIds
property is a simple array of ids without any information about the corresponding board id.
{
"id": "connect_boards",
"type": "board-relation",
"text": "Item 1, Item 2, Item 3, Item 4, Item 3",
"value": "{\"linkedPulseIds\":[{\"linkedPulseId\":3184597779},{\"linkedPulseId\":3184597784},{\"linkedPulseId\":3184597788},{\"linkedPulseId\":3184598104},{\"linkedPulseId\":3184598103}]}",
"additional_info": null
},
The array is
[{\"linkedPulseId\":3184597779},{\"linkedPulseId\":3184597784},{\"linkedPulseId\":3184597788},{\"linkedPulseId\":3184598104},{\"linkedPulseId\":3184598103}]}
How the are distributed among the linked boards?
Thanks for your help.