mdev
(Matt Dev)
October 25, 2020, 7:31pm
1
I am experiencing difficulty creating items with tag column values. The items create, but the tag values are not being set.
I saw from this previous question that tags need to be created and then passed as ID to the create_item call:
Hi There,
Trying to integrate a WPform with Monday using Zapier.
Can i populate a Monday Tag field ?
If true, how do i access it using the Jason format ?
{âTags_1â : {âtagâ:[âThisâ]}}
Regards,
Fabian
So my first mutation to create the tag is this:
mutation { create_or_get_tag (tag_name: "myNewTag", board_id: 785566686) {
id
}
}
I then use that ID to create the item with the tag_ids like so:
mutation {
create_item (
board_id: 785566686,
group_id: "group_title",
item_name: "item_name",
column_values: "{\"status\":{\"label\":\"Medium\"},\"tag\":{\"tag_ids\":[7481612]}}"
) { id }
}
When I perform that mutation from the API explorer, it is successful, but I am not seeing the tag on the new item in my board. Is there something wrong with the way I am trying set the tag values in the column_values? ( note, status does set correctly ).
cc / @Scott-monday.com
dsilva
(Daniel Silva)
October 27, 2020, 10:05pm
3
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
mdev
(Matt Dev)
October 28, 2020, 12:51am
4
@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:
dsilva
(Daniel Silva)
November 3, 2020, 9:35pm
5
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
mdev
(Matt Dev)
November 10, 2020, 4:53pm
6
@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!
tuesdayman
(Shah Auckburaully)
November 18, 2020, 10:46am
7
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.
dsilva
(Daniel Silva)
November 19, 2020, 8:23pm
8
Hey @tuesdayman - could you try the above query without the number sign?
-Daniel
tuesdayman
(Shah Auckburaully)
November 20, 2020, 11:47am
9
@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"}})}
mdev
(Matt Dev)
November 21, 2020, 12:05am
10
@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.
1 Like