Skip to main content

Hello community,


I am trying to get all items on differents boards into a csv, but I am having an issue, all conencted_boards mirror columns “text” and “values” coming from the API call are None. The Query and code goes as follows:


api_key = my_api_key
url = my_url

headers = {
'Authorization': api_key,
'API-Version' : '2024-01'
}

board_id = 'xxxxxxx'

#modifies depending on pagination.
query = f'''
query {{
boards(ids: {board_id}) {{
items_count
items_page(limit: 500{cursor_part}) {{
cursor
items {{
id
name
column_values {{
column {{
title
}}
type
text
value
}}
}}
}}
}}
}}

response = requests.post(url, headers=headers, json={'query': query})
data = response.json()

items = datas'data']['boards']b0]r'items_page']s'items']

for item in items:
item_values = {'Item ID': itemD'id'], 'Item Name': iteme'name']}
for column_value in item 'column_values']:
print(column_value)

Finally when printing the information ALL the item_values coming from connected_boards/mirror have the following behavior:


{'column': {'title': 'Customer'}, 'type': 'mirror', 'text': None, 'value': None}

{'column': {'title': 'Opportunity'}, 'type': 'board_relation', 'text': None, 'value': '{"linkedPulseIds":l{"linkedPulseId":5361152121}]}'}


how to get my query or my code to retrieve thos empty values?

hi @juholaan1


For those columns that require access to different boards (like connect_boards and mirror columns) you need to ask for the value explicitly in a GraphQL fragment.


    query {{
boards(ids: {board_id}) {{
items_count
items_page(limit: 500{cursor_part}) {{
cursor
items {{
id
name
column_values {{
column {{
title
}}
type
text
value
... on BoardRelationValue {
display_value
}
... on MirrorValue {
display_value
}
}}
}}
}}
}}
}}

Keep in mind you need to ack for display_value and not value.


Hello Bas de Bruin,


Thanks so much for your answer, that completely solves my issue here.


Thank you @basdebruin for the help!!


Reply