Issue with mutation - change_column_value with date column

Hi there,

I’ve been using the Monday API to automatically post updates to a board for several weeks now. One of the columns that I’m changing is a Date column. Starting yesterday, all of my requests to change columns of this type have returned 400 errors, with the message:

{
  "error_code": "ColumnValueException",
  "status_code": 400,
  "error_message": "change_column_value invalid value",
  "error_data": {
    "column_value": "{\"date\"=>\"2019-11-1\", \"time\"=>\"12:39:00\"}",
    "column_type": "DateColumn"
  }
}

My query, obviously, does not have “=>” in it. My query looks like this:

mutation
    {
        change_column_value(
            board_id: 12335234,
            item_id: 2312342341231,
            column_id: date,
            value: "{\"date\":\"2019-11-1\", \"time\":\"12:39:00\"}"
        ) {
            id
            name
            column_values {
                id
                text
                value
            }
        }
    }

which, according to your documentation, is correct. Any input as to what could be happening/ what I’m doing wrong? Thanks!

1 Like

Hey @chdastolfo, welcome to the community :slight_smile:

I tested this and I know the issue :slight_smile: Our date column expects dates in YYYY-MM-DD format, and your date is 2019-11-1 instead of 2019-11-01.

image

Let me know if that helps!

@dipro
I am also having issue with date format. I am sending it in YYYY-mm-dd format but still I am getting invalid date format issue.

{
  "error_code": "ColumnValueException",
  "status_code": 400,
  "error_message": "change_column_value invalid value",
  "error_data": {
   "column_value": "2020-01-19",
   "column_type": "DateColumn"
 }

}

Can you please let me now what I am missing.

I am getting the exact same problem. blocking development

{
“error_code”: “ColumnValueException”,
“status_code”: 400,
“error_message”: “change_column_value invalid value”,
“error_data”: {
“column_value”: “2021-01-31”,
“column_type”: “DateColumn”
}
}

HI @jeffnb and @devendra! Thanks for posting about this - happy to help. I see that you are both formatting the value string like this below:
image

Could you try altering the value string to reflect this format for mutating the date column? You’d need to format this stringified JSON object with a date key (see below).

You can see here on developers.monday.com - https://monday.com/developers/v2#column-values-section-date

After looking at our documentation, it looks like the format you were using is for mutating text columns possibly?

Does that work for you both? Cheers!
-Laura

@lauralev Thanks it worked.

hi !
Im trying it too but for me its not working

const query2 =`mutation {

        change_column_value (board_id: ${req.body.data.boardid}, item_id: ${item.create_item.id}, column_id: "due_to", value: "{\"date\":\"2020-01-09\"}") {

            id

          }

       }`

and the error I get :

(node:26156) UnhandledPromiseRejectionWarning: Error: Parse error on “:” (STRING) at [2, 107]: {“response”:{“errors”:[{“message”:“Parse error on “:” (STRING) at [2, 107]”,“locations”:[{“line”:2,“column”:107}]}],“account_id”:5593070,“status”:200},“request”:{“query”:“mutation {\n change_column_value (board_id: 453149783, item_id: 453319956, column_id: “due_to”, value:”{“date”:“2020-01-09”}") {\n id\n
}\n }"}}
at GraphQLClient. (C:\Users\aviram\meetee0.3\node_modules\graphql-request\dist\src\index.js:116:35)
at step (C:\Users\aviram\meetee0.3\node_modules\graphql-request\dist\src\index.js:40:23)
at Object.next (C:\Users\aviram\meetee0.3\node_modules\graphql-request\dist\src\index.js:21:53)
at fulfilled (C:\Users\aviram\meetee0.3\node_modules\graphql-request\dist\src\index.js:12:58)
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:26156) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:26156) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.