I’m writing a simple resource management application, where staffers enter for each month the percent of their time they spend on various projects. I store those allocations as "percent’ fields in an Airtable table.
I collect inputs for these from a node.js web page, and want to update the allocations in the database.
When I pass the values to the update() function, I see the following:
error: ‘INVALID_VALUE_FOR_COLUMN’,
message: ‘Field May 17 can not accept value 15’,
I suspect that the system is seeing string values instead of the required number values, but don’t know how to deliver the correct format from JS.
I’ve tried the value with and without quotes, and also tried submitting parseInt(value).
Note: I’m also using eval() to generate the update() command, as my function handles the update field names as variables, which also seem to be a problem
// build the update string
var updatestr = "base(\'allocations\').update(\'" + request.body\i].allocid + "\', {";
updatestr += "\\"" + request.body\i].month + "\\":y" + request.body:i].pct + "]";
updatestr += "}, function(err, record) { \
if (err) { console.log(err); return; }\
console.log(record);\
});";
console.log(updatestr);
eval (updatestr);