I have table with 3 fields name(lastname,firstname, email). id seems to be auto incremented in airtable.
Now am trying to update records where id is 1 with the code below but it displays error below
here is the code
I have table with 3 fields name(lastname,firstname, email). id seems to be auto incremented in airtable.
Now am trying to update records where id is 1 with the code below but it displays error below
here is the code
1.) update records where id is = 1
const first_update = base.getTableByNameIfExists('myfirst_table');
// Update cell values
//{id: record1.id, fields: {'My field name': 'updated value 1'}},
const ok = first_update.updateRecordAsync({id: '1', fields: {'lastname': 'Carrots-2','firstname': 'joy-2', 'email': 'joy-2@gmail.com'}});
if(ok){
alert('records updated successfully');
}
2.) update record where id is = 1 and email is = john@gmail.com
const first_update2= base.getTableByNameIfExists('second_table');
// Update cell values
//{id: record1.id, fields: {'My field name': 'updated value 1'}},
const ok1 = first_update2.updateRecordAsync({id: '1', 'email': 'john@gmail.com', fields: {'lastname': 'Carrots-2','firstname': 'joy-2', 'email': 'joy-2@gmail.com'}});
if(ok1){
alert('records updated successfully');
}
Error running block
entries@https://localhost:9000/__runFrame/bundle.js:13084:17
_cellValuesByFieldIdOrNameToCellValuesByFieldId@https://localhost:9000/__runFrame/bundle.js:9983:60
updateRecordsAsync$/recordsWithCellValuesByFieldId<@https://localhost:9000/__runFrame/bundle.js:9205:43
updateRecordsAsync$@https://localhost:9000/__runFrame/bundle.js:9203:56
tryCatch@https://localhost:9000/__runFrame/bundle.js:74212:40
invoke@https://localhost:9000/__runFrame/bundle.js:74441:30
defineIteratorMethods/</prototype[method]@https://localhost:9000/__runFrame/bundle.js:74264:21
tryCatch@https://localhost:9000/__runFrame/bundle.js:74212:40
invoke@https://localhost:9000/__runFrame/bundle.js:74302:28
callInvokeWithMethodAndArg/<@https://localhost:9000/__runFrame/bundle.js:74337:17
callInvokeWithMethodAndArg@https://localhost:9000/__runFrame/bundle.js:74336:16
enqueue@https://localhost:9000/__runFrame/bundle.js:74359:13
defineIteratorMethods/</prototype[method]@https://localhost:9000/__runFrame/bundle.js:74264:21
[419]</runtime</exports.async@https://localhost:9000/__runFrame/bundle.js:74386:14
updateRecordsAsync@https://localhost:9000/__runFrame/bundle.js:9199:35
updateRecordAsync$@https://localhost:9000/__runFrame/bundle.js:8986:54
tryCatch@https://localhost:9000/__runFrame/bundle.js:74212:40
invoke@https://localhost:9000/__runFrame/bundle.js:74441:30
defineIteratorMethods/</prototype[method]@https://localhost:9000/__runFrame/bundle.js:74264:21
tryCatch@https://localhost:9000/__runFrame/bundle.js:74212:40
invoke@https://localhost:9000/__runFrame/bundle.js:74302:28
callInvokeWithMethodAndArg/<@https://localhost:9000/__runFrame/bundle.js:74337:17
callInvokeWithMethodAndArg@https://localhost:9000/__runFrame/bundle.js:74336:16
enqueue@https://localhost:9000/__runFrame/bundle.js:74359:13
defineIteratorMethods/</prototype[method]@https://localhost:9000/__runFrame/bundle.js:74264:21
[419]</runtime</exports.async@https://localhost:9000/__runFrame/bundle.js:74386:14
updateRecordAsync@https://localhost:9000/__runFrame/bundle.js:8980:35
[2]<@https://localhost:9000/__runFrame/bundle.js:76:20
o@https://localhost:9000/__runFrame/bundle.js:1:265
o/<@https://localhost:9000/__runFrame/bundle.js:1:316
runBlock@https://localhost:9000/__runFrame/bundle.js:29:33
e/<@https://static.airtable.com/js/by_sha/8f4b64fb/block_frame.js:1:2329961
r@https://static.airtable.com/js/lib/regenerator-runtime.min.js:1:160
L/<@https://static.airtable.com/js/lib/regenerator-runtime.min.js:4:58
D/</a[b]@https://static.airtable.com/js/lib/regenerator-runtime.min.js:1:339
F@https://static.airtable.com/js/by_sha/8f4b64fb/block_frame.js:1:2324534
a@https://static.airtable.com/js/by_sha/8f4b64fb/block_frame.js:1:2324738