Updating a dropdown column using labels?

Hi,

I’m trying to use the API v2 to change the values in a dropdown column. The first instruction works. The other two are not. But should work according to the instructions at https://monday.com/developers/v2#column-values-section-dropdown

The following three actions should all always lead to the same result. That’s not the case. Only the first one results as expected.

My primary interest is an update using the labels instead of the ids.

Can someone help please?

Thnx a lot
Michael

Instruction: mutation { change_column_value(board_id: 123, item_id: 456, column_id: “status2”, value: “{"ids":[1]}”) { id } }
Expected: value: "{"ids": [1]}
Result: value: "{"ids": [1]}

Instruction: mutation { change_column_value(board_id: 123, item_id: 456, column_id: “status2”, value: “{"id":1}”) { id } }
Expected: value: "{"ids": [1]}
Result: value: "{"ids": null}

Instruction: mutation { change_column_value(board_id: 123, item_id: 456, column_id: “status2”, value: “{"label":"xyz"}”) { id } }
Expected: value: "{"ids": [1]}
Result: value: "{"ids": null}

Hi Michael,

Thanks for taking the time to reach out to us in regards to this! To be transparent, the 2nd and 3rd examples you provided include bugs with the API that we’re aware of and are slated to be resolved in the future :muscle:

The Dropdown Column itself, until quite recently, only supported having a single selected value at a time. We’ve since updated it so you can select multiple values. Our API documentation hasn’t quite fully caught up with that change, but we’re workin’ on it!

In the meantime, you’ll need to select multiple values utilizing the index instead of labels. As well as utilize the format “{“ids”:[1]}”) instead of “{“id”:1}”) in your API calls.

I’ve shared your feedback with our development team here so we can get this updated soon :raised_hands:

Best,
Scott

I’d also definitely look forward to be able to use the API to select multiple values for a dropdown column :+1:

1 Like

Howdy! :wave:

To further clarify, you can use the API to select multiple values within a dropdown column. You’ll just need to use the index instead of the labels for now.

I made a slight edit to my original post to make that more clear :wink:

Best,
Scott

Hey Scott, is this still the case or can we use the label names as documented? I tried this but the column status label is not updated, it is merely cleared, regardless of what I pass.

    value: "{\"labels\":[\"Done\"]}"

This doesn’t update it to. “Done” , it just clears the status. The label text is an exact match to what I see as my options through the UI. I also tried updating this through the indexes "{\"ids\":[1]}", this also clears any current value.

@paulpop, It should work. But, the syntax is:

    .... value: "{\"label\":\"Done\"}"....
2 Likes

Hi I am using ```
{“dropdown”:{“value”:"{“label”:“DONE”}"} still it is not working. am I missing anything.

wishing to get help from you.

thanks
Mamun

@mamun ,

Please give more detail. Where are you using this? What is the complete syntax of the command?

But, to address your syntax directly, if you were using the API Playground, it should look something like this…

 mutation { change_column_value (board_id: 20178755, item_id: 200819371, column_id: "dropdown", value: "{\"label\": \"DONE\"}") { id } }

Hi @JCorrell ,
thank you a lot for the reply, hope I will get another reply from you soon.

following is my query. I am able to set
following is my data to save … I’m able to save Person, People but can’t set the dropdown one. if I set it using index say “{“dropdown”:{“ids”:[1]},“status”:{“label”:“New”}}” then it is working. but I do not have the index value from where I am trying to create Item record.

settings.data
“{“query”:“mutation {create_item (board_id: 977514374, group_id: “topics”,item_name:“Task 1”,column_values:”{\“dropdown\”:{\“value\”:\”{\\\“label\\\”:\\\“JGNL\\\”}\"},\“status\”:{\“label\”:\“New\”},\“people\”:{\“personsAndTeams\”:[{\“id\”:15680801,\“kind\”:\“person\”}]},\“person\”:{\“personsAndTeams\”:[{\“id\”:15680801,\“kind\”:\“person\”}]}}") {id}}"}"

Hey @mamun :wave:

Thanks for adding further context to your request!

Just to clarify, you can query for all indexes and labels of a Dropdown column like so:
image

That said, I’ve just tried to run a simple mutation, creating an item with multiple dropdown labels selected. Perhaps this example can help:

mutation {

create_item(board_id:boardid, group_id:“topics”, item_name:“test dropdown value with labels”, column_values:"{“dropdown” : {“labels”:[“XYZ”,“John Doe”]}}") {
id
}
}

Even fi you are using a single label as the value, you will still need to send it as an array, like so:

{\"labels\":[\"XYZ\"]

Does that make sense? Let me know :slight_smile:

-Alex

thanks I have used it and worked.

thanks
Mamun

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.