Looking for some aid or suggested alternate solution on how to use the API to move/convert an item within a group, to a subitem within the same group.
Have:
Wanted:
Current Workflow:
I have been successful with taking the name of the group and creating an additional item within its group. For example:
I have also been successful with creating the subitem in Group One, however, the columns do not transfer over. I’d like to avoid this methodolgy since it requires me to first query and format the group data to be fed into “create_subitems”. Seems like a very redundent method. (Note, the printed column_values in the code do not match the picture. Just an example).
def create_subitem_for_item(item_id, sub_item_name, column_values):
query = """
mutation ($itemId: ID!, $subItemName: String!, $columnValues: JSON) {
create_subitem (
parent_item_id: $itemId,
item_name: $subItemName,
column_values: $columnValues
create_labels_if_missing: true
) {
id
}
}
"""
variables = {
'itemId': item_id,
'subItemName': sub_item_name,
'columnValues': json.dumps(column_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
>>>
{'itemId': '123', 'subItemName': 'Item 1', 'columnValues': '{"text1":"\\\\"Some Text\\\\"","text2":"\\\\"Some More Text\\\\"","number1":"\\\\"200\\\\"","number2":"\\\\"12541.9\\\\""}'}
{'data': {'create_subitem': {'id': '1234'}}, 'account_id': 56789}
Question 1:
I know in monday.com you can select the item row and then “convert” into a subitem. Is there a way to do that through the API?
Question 2:
If there is no API methodology, how do I create a subitem with desired columns and it’s respective values? It seems that I am building out the column_values correctly within create_subitem, yet the columns nor the values are being built.
“”“”
Let me know if you need additional information/examples.




