Country
The country column represents a country. You can find the list of available countries here. Our API supports this column, so you can read and update the country column via the API.
Reading the country column
You can return the data in a country column in two different formats. The text field will return the data as a simple string, and the value field will return the data as a JSON string.
{
"text": "United States",
"value": "{\"changed_at\":\"2022-07-21T12:00:00.000Z\",\"countryCode\":\"US\",\"countryName\":\"United States\"}"
}
Updating the country column
JSON
You can update a country column with a JSON string. Simple string updates are not supported.
To update a country column, send the ISO-2 country code (a two-letter code) and the country name.
mutation {
change_multiple_column_values(item_id:11111, board_id:22222, column_values:"{\"country3\":{\"countryCode\":\"US\",\"countryName\":\"United States\"}}"){
id
}
}
fetch ("https://api.monday.com/v2", {
method: 'post',
headers: {
'Content-Type': 'application/json',
'Authorization' : 'YOUR_API_KEY'
},
body: JSON.stringify({
query : "mutation ($myBoardId:Int!, $myItemId:Int!, $myColumnValues:JSON!) { change_multiple_column_values(item_id:$myItemId, board_id:$myBoardId, column_values: $myColumnValues) { id } }",
variables : JSON.stringify({
myBoardId: YOUR_BOARD_ID,
myItemId: YOUR_ITEM_ID,
myColumnValues: "{\"country3\": {\"countryCode\" : \"US\", \"countryName\": \"United States\"}}"
})
})
})
You can find the Postman request to change the country column here.
Clearing the country column
You can clear the country column using a change_multiple_column_values
mutation.
mutation {
change_multiple_column_values(item_id: 2973227073, board_id: 2973227049, column_values: "{\"country\" : {}}") {
id
}
}
Have questions?
Join our developer community! You can share your questions and learn from fellow users and monday.com product experts.
Donβt forget to search before opening a new topic!
Updated 3 days ago