Date Column Problem with API

Hello, I’m having trouble creating a subitem via the API with the Date column automatically filed. The subitem is correctly created, and I have no problems with other columns, but the date column just will not update. It is left blank on every created subitem.

Any thoughts on what I’m doing wrong below?

I’m using PHP. Here is my code:

$query = ‘mutation ($myItemName: String!, $columnVals: JSON!) { create_subitem (parent_item_id:(redacted), item_name:$myItemName, column_values:$columnVals) { id, board { id } } }’;
$vars = [‘myItemName’ => ‘TestItem’,
‘columnVals’ => json_encode([
‘status’ => [‘label’ => ‘Done’],
‘Date’ => [‘date’ => ‘2021-01-02’]
])];

$data = @file_get_contents($apiUrl, false, stream_context_create([
‘http’ => [
‘method’ => ‘POST’,
‘header’ => $headers,
‘content’ => json_encode([‘query’ => $query, ‘variables’ => $vars]),
]
]));
$responseContent = json_decode($data, true);

echo json_encode($responseContent);

Hi @zonajustin!

Hmm that’s weird-- it looks alright to me.

It looks like your columnVals are also being encoded in JSON format, right?

What’s the error that you’re getting? Or is it just that the Date column is empty and there’s no error message?

Thanks for walking me through it!

-Helen