Problem on my Script Suddenly

I suddenly get an error while executing my script. “There was an unexpected error while executing your script”. It doesn’t say which one causes it. I only change my table name and change immediately the value on the gsctable variable.

let gsctable = base.getTable("CBD B2B DE 5");
let query = await gsctable.selectRecordsAsync();
let today = new Date();
let year = new Intl.DateTimeFormat('en', { year: 'numeric' }).format(today);
let month = new Intl.DateTimeFormat('en', { month: '2-digit' }).format(today);
let day = new Intl.DateTimeFormat('en', { day: '2-digit' }).format(today);
let todate = `${year}-${month}-${day}`;

let lw = new Date(today.getFullYear(), today.getMonth(),today.getDate()-7);
let ly = new Intl.DateTimeFormat('en', { year: 'numeric' }).format(lw);
let lm = new Intl.DateTimeFormat('en', { month: '2-digit' }).format(lw);
let ld = new Intl.DateTimeFormat('en', { day: '2-digit' }).format(lw);
let lastweek = `${ly}-${lm}-${ld}`;

for(let dates of query.records){
    let todaycell = dates.getCellValue('EndDate'); //End Date
    let lastweekcell = dates.getCellValue('StartDate');//Start Date
    if(todate != todaycell){
        await gsctable.updateRecordAsync(dates,{
         "Update":todate
        })
    }
}

Well, that makes your first step in debugging this easy enough - does changing back the table name and its variable reference restore the original behavior?

If not, how about restoring your base from a snapshot and seeing if the issue is present?
If it isn’t, try changing the snapshot’s table name to what you did the first time - see if you can replicate the problem.
If not, try changing it to something else entirely, etc.

We are having the same problem at present with no changes implemented from a user perspective. It looks like an airtable issue but at present i’m awaiting feedback from the helpdesk.

2 Likes

I’m having the same issue. I even tried just a simple script

console.log(Hello, ${base.name}!);

and it failed with this message

ERROR

There was an unexpected error while executing your script.

Any ideas?

Thanks

Claire

same here, my base is stuck at automation “in progress” level

Looks like an Airtable issue.

1 Like