![Marc_Justin_Rai Marc_Justin_Rai](https://community.airtable.com/legacyfs/online/avatars/2X/b/b4c8ad235ef15808f0c4677a3d11c093bfa52ecc.png)
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sep 16, 2021 12:03 AM
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
})
}
}
![Dominik_Bosnjak Dominik_Bosnjak](https://community.airtable.com/legacyfs/online/avatars/3X/c/3/c3dc77c5f8a75254e9b74528523b0beabcf5be64.png)
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sep 16, 2021 02:20 AM
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.
![Jack_Evans Jack_Evans](https://community.airtable.com/legacyfs/online/avatars/2X/b/b4c8ad235ef15808f0c4677a3d11c093bfa52ecc.png)
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sep 16, 2021 03:40 AM
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.
![Claire_Conza Claire_Conza](https://community.airtable.com/legacyfs/online/avatars/3X/5/2/528b31e1e59522b06b1440f02b74324ba716c6a1.jpeg)
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sep 16, 2021 04:24 AM
![Costantini_s_r_ Costantini_s_r_](https://community.airtable.com/legacyfs/online/avatars/3X/d/8/d8445a051e22523bd20276c802a33a4a93adf596.jpeg)
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sep 16, 2021 04:36 AM
same here, my base is stuck at automation “in progress” level
![kuovonne kuovonne](https://community.airtable.com/legacyfs/online/avatars/3X/b/c/bcecb2d58f8302e9d9f520621c02ff41be54488c.jpeg)
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sep 16, 2021 04:47 AM
Looks like an Airtable issue.
![](/skins/images/DD0CD7D0ACF200EF4456420D87029A3D/responsive_peak/images/icon_anonymous_message.png)