Fix for INVALID_VALUE_FOR_COLUMN for single line text column

#1

This behavior started a couple weeks ago. Using Airtable’s airtable JS API v0.5.8, I used to be able to call update() successfully on table where the value for column to be updated was a javascript number.

Now it returns the error INVALID_VALUE_FOR_COLUMN. When I convert the number to a string before passing it into the update() call, it works.

Just a workaround FYI for others. It seems like is some stronger API checking going on on the Airtable server API side.

0 Likes

#2

Interesting—I wonder if this is a newly-introduced bug. Are you failing to update a number field with a number, or a number field with a string, or a text field with a number? (Or something else?)

Sample code and a description of the base would help us reproduce this so we can get this solved.

0 Likes

#3

@Case_Larsen - is it possible you forgot to use the {typecast:true} feature in your recent calls?

0 Likes

#4

Here’s a repro case for a table with column “SingleLineText” which is of type single line text:

var Airtable = require('airtable')
var base = new Airtable({ apiKey: '<your key>' }).base('<your table id>')

base('Table 1').create({
  'SingleLineText': 123
}, function (err, record) {
  if (err) { console.error(err); return }
  console.log('created', record.getId())
})

base('Table 1').create({
  'SingleLineText': '456'
}, function (err, record) {
  if (err) { console.error(err); return }
  console.log('created', record.getId())
})

results in

created recc5jiGDbSGlpEsR
Class {
  error: 'INVALID_VALUE_FOR_COLUMN',
  message: 'Field SingleLineText cannot accept the provided value',
  statusCode: 422 }

and resulting table having only one row with “456” in the SingleLineText column. i.e. the operation with 123 failed.

@openside I didn’t see typecast in the documentation, and it had been working for a few weeks already as-is, but good to know.

As said, i think it’s probably increased API strictness (not a bug) which is ok, and the original request submitted an integer, not a string value, so I’d still need to cast values to a string before adding the typecast directive.

0 Likes

#5

We’ll look into whether this is a bigger issue, so thanks for bringing this to our attention.

It sounds like your issue has been solved, which is great! Let us know if you run into any other issues (or if I misunderstood and your issue isn’t solved).

0 Likes