Record not updating on Error

366 2
Showing results for 
Search instead for 
Did you mean: 
6 - Interface Innovator
6 - Interface Innovator


I'd like to insert the error message into a field, so I used try catch with both of them updating a variable, which I then used to update the field. Weird; it only updated on success, not on error. Can anyone help?


let config = input.config();
const recordId = config.recordid;
let tabletable = config.tabletable;
let table = base.getTable(tabletable);
let query = await table.selectRecordsAsync({ fields: ["Error"] });
let err;
try {
    await table.updateRecordAsync(recordId, {
        "Eat": "Cheese" // no such field
    err = "Code executed successfully";
} catch (error) {
    err =  error.message;
    } finally {
    await table.updateRecordAsync(recordId, {
        "Error": err

console.log("Updated a record!");



"Could not find a field with name or ID "Eat"."
Error: Could not find a field with name or ID "Eat".
    at main on line 16

As you can see, err was properly logged. But the record was not updated.


2 Replies 2
5 - Automation Enthusiast
5 - Automation Enthusiast

table.updateRecordAsync returns a Promise, and its error handling is different. The failure will not go to the catch block as you've written.

You should use catch as how it's used in this reply:

But it caught the err, and pushed it out to console.log. It just didn't update the error field in the table.