Help

Invalid Value for Column Error for a Duration Field

Topic Labels: API
1845 1
cancel
Showing results for 
Search instead for 
Did you mean: 
roosevelt
4 - Data Explorer
4 - Data Explorer

Hi,

I am having some trouble with a Patch request to update a Duration field.

The error I’m getting is this:

{error: {type: "INVALID_VALUE_FOR_COLUMN", message: "Field Time Spent can not accept value 5306"}}

But what’s interesting is, if I change the field type to “Single line text,” it works fine and updates the field as expected.

Here’s how my header looks in both cases:

header

Am I formatting the value wrong for the ‘Duration’ field type? I tried converting 5306 seconds to “01:28:20” string but I got the same error.

Any thoughts?

Thanks,
Roosevelt

1 Reply 1
Andrew_Johnson1
8 - Airtable Astronomer
8 - Airtable Astronomer

Perhaps you are passing the data as a string i.e adding quotes to your value(in this case 5306), and as a result the API thinks you are passing a string…
That is why it is working when you change the field type to “Single line text”.

To correctly pass the data it would be something like

“Time Spent”: 5306