The API documentation indicates that both the ISO 3166-1 alpha-2 code and the full country name are required in order to update a column with type Country
. While it’s not necessarily difficult to map between the two if one only has one or the other, I wanted to test its requirements and drill down into edge cases.
In doing so, it seems that the country name is not strictly required to have a value and is only required for its property to be present. That is, the column will update, and do so correctly, based entirely on the code.
For example, all of the following mutations update a country column with United States as the visible value and a U.S. flag within the column.
mutation ($itemId: Int!, $boardId: Int!) {
change_multiple_column_values (
item_id: $itemId,
board_id: $boardId,
column_values: "{ \"country_1\": { \"countryCode\": \"US\", \"countryName\": \"United States\" }}"
) {
id
}
}
mutation ($itemId: Int!, $boardId: Int!) {
change_multiple_column_values (
item_id: $itemId,
board_id: $boardId,
column_values: "{ \"country_1\": { \"countryCode\": \"US\", \"countryName\": \"\" }}"
) {
id
}
}
mutation ($itemId: Int!, $boardId: Int!) {
change_multiple_column_values (
item_id: $itemId,
board_id: $boardId,
column_values: "{ \"country_1\": { \"countryCode\": \"US\", \"countryName\": \"monday.com\" }}"
) {
id
}
}
Now, if you query the item back, it will indeed contain whatever countryName
you updated it with, whether that’s a valid country name (like the first example) or something useless (like examples 2 and 3).
So, it seems the countryName
is not strictly required for updating the field. Now, using a country code that is either obviously bad (""
, lj09u9
, among others) results in a ColumnValueException
, even if countryName
is valid (e.g. United States
).
It appears, then, that the code is the only true requirement. Is this behavior something I can rely on?