Column Values are blank - Python (API) - creating new item

Only the item name appears in Monday.

The columns are empty. I tried removing the label and text - same result.

Code:

import requests
import json
apiKey = "HIDDEN"
apiUrl = "https://api.monday.com/v2"
headers = {"Authorization": apiKey}
query5 = "mutation ($myItemName: String!, $columnVals: JSON!) { create_item (board_id:HIDDEN, item_name:$myItemName, column_values:$columnVals) { id } }"
vars = {"myItemName": "Hello everyone!","columnVals": json.dumps({"link": {"link": "www.google.com"}, "people1": {"multiple-person": "Jane"}}),}
data = {"query": query5, "variables": vars}
r = requests.post(url=apiUrl, json=data, headers=headers) # make request print(r.json())

The ids of the columns are correct. I checked.

What am I doing wrongly here?

Thank you.

Hey @tuesdayman - there’s two changes you would want to make to your variables.

The first would be to modify the link column to follow our parameters:

        "link": {"url": "www.google.com","text":"test"},

The second change is related to the people column - currently this would require you to send the ID of the person to update the column (please see documentation).

-Daniel

Thank you @dsilva.

I got the link to appear. The multiple-person field (people1) results in this syntax error:

vars = {"myItemName": "test!","columnVals": json.dumps({"link": {"url":"wwww.google.com","text":"google.com"},"people1": {"multiple-person": {"14123922":"kind":"person"},{"12472244":"kind":"person"} }}),}
^
SyntaxError: invalid syntax

The code:

vars = {"myItemName": "test!","columnVals": json.dumps({"link": {"url":"wwww.google.com","text":"google.com"},"people1": {"multiple-person": {"14123922":"kind":"person"},{"12472244":"kind":"person"} }}),}

Can you please assist? Thanks.

The type in the JSON output listing all attributes doesn’t match the API types. E.g. link is a type in Monday UI but for the API, we have to use url.

Odd!

Fixed the issue for people. Thank you @dsilva. This worked. I didn’t have to add “people” or “multi-person” in the query.

My next issue is tags not appearing - likely due to type of attribute.

vars = {"myItemName": "test!","columnVals": json.dumps({"link": {"url":"wwww.google.com","text":"google.com"},"people1":"14123922,12472244","tags":{"text":"#fdfd3"}}),}

Hey @tuesdayman - could we try the tag without the # sign?

-Daniel