I am running into a problem where while creating a column with a status type and creating the possible labels, some labels are not appearing. However, the return json shows they are there and the column summary also shows there is a value there.
Any idea what may be causing this? Am I hitting some sort of limit?
Note, I skip label 5 because monday.com sets label 5 as the default empty value.
def create_columns(board_id, title, column_type, default_values=None):
if default_values:
vals_dict = {}
for cnt, vals in enumerate(default_values):
if cnt == 4:
cnt += 1
vals_dict[cnt + 1] = vals
status_values = {"labels": vals_dict}
else:
status_values = ''
query = """
mutation ($boardId: ID!, $titleName: String!, $columnType: ColumnType!, $defaultValues: JSON) {
create_column(
board_id: $boardId
title: $titleName
column_type: $columnType
defaults: $defaultValues
) {
id
title
}
}
"""
variables = {
'boardId': board_id,
'titleName': title,
'columnType': column_type,
'defaultValues': json.dumps(status_values, separators=(',', ':'))
}
datas = {
'query': query,
'variables': variables
}
r_boards = requests.post(url=apiUrl, headers=headers, data=json.dumps(datas)) # make request
print(variables)
print(r_boards.json())
return r_boards
>>>
{'boardId': '1234', 'titleName': 'Location', 'columnType': 'status', 'defaultValues': '{"labels":{"1":"label one","2":"label two","3":"label three","4":"label four","6":"label six","7":"label seven","8":"label eight","9":"label nine","10":"label ten","11":"label eleven","12":"label twelve","13":"label thirteen","14":"label fourteen","15":"label fifteen","16":"label sixteen","17":"label seventeen","18":"label eighteen","19":"label nineteen","20":"label twenty","21":"label twenty one","22":"label twenty two"}}'}
{'data': {'create_column': {'id': 'location', 'title': 'Location'}}, 'account_id': 12345}
Column Labels
When a item with “label twenty” is created