How do you create new item on monday using python? Below is the code that is being used -- on a board there are multiple columns that need to be populated. How to target a specific column and provide it with a value?
def CREATE_data(api_key:str) -> None:
''' fn creates new row item on Monday.com '''
api_url = "https://api.monday.com/v2"
headers = {'Authorization': api_key}
query = 'mutation ($columnVals: JSON!) { create_item (board_id:3539729472, item_name:"TEST", column_values: $columnVals) { id } }'
vars = {
'columnVals': json.dumps({
'date' : '1993-08-27'
})
}
data = {'query' : query, 'variables': vars}
r = requests.post(url=api_url, json=data, headers=headers) # make request
print(r.json())
Tired the code above and am trying to populate specific columns with values
There is not much information of what exactly you are trying but according to the tutorial. You have to specify the columns with the json.
Look at creating a new item. https://support.monday.com/hc/en-us/articles/360013483119-API-Quickstart-Tutorial-Python