Hey @mdev - welcome to the community!
The create_or_get_tag
mutation is fairly new - let me try and re-create this behavior on my end with the team and get back to you.
Could you let me know if this was previously working for you?
-Daniel
@dsilva No, I wasn’t able to get it to work from the api explorer or from the monday javascript sdk.
Here is a clip of the issue:
Hey @mdev - apologies for the delay! This took a bit more testing on our end to resolve.
We used the following query to create the tag and get the ID, just like the one you posted above:
mutation { create_or_get_tag (tag_name: "HelloWorld", board_id: xxxx) {
id
}
}
From there, we modified the ‘create_item’ query you provided to send the information needed to the API in JSON format:
mutation {
create_item (
board_id: xxxxx,
item_name: "This is my item",
column_values:"{\\"tags\\":{\\"tag_ids\\":\7583426]}}"
) { id }
}
One thing I did notice is that if a board does not have any tags at all, you won’t see them appear until you refresh your browser.
Hope this helps!
-Daniel
@dsilva
It looks like the issue was the tag column name I was using. the actual name value had to be tags36
for my particular case.
I guess ill need to query the board to check which column is a tag type to determine the name before creating the item, rather than assuming it will always be tags
.
Thank you!
Reviving this threat - I tried the following:
vars = {"myItemName": "test!","columnVals": json.dumps({"link": {"url":"wwww.google.com","text":"google.com"},"people1":"14123922,12472244","tags":{"tag_ids":"#fdfd3"}}),}
The name hasn’t changed in my case. The tag doesn’t appear at all - even after reloading the page.
Hey @tuesdayman - could you try the above query without the number sign?
-Daniel
@dsilva the entire query results in no output.
See below:
vars = {"myItemName": "2342323!","columnVals": json.dumps({"link": {"url":"wwww.google.com","text":"google.com"},"people1":"14123922,12472244","timeline":{"from":"2019-06-03", "to":"2019-06-15"},"tags":{"tag_ids":"fdfd3"}})}
@tuesdayman Should columnVals
be column_vals
? Have you tried using the API explorer?
If you use it, you can also confirm the tag name / id values for the board you are trying to create an item for.