Jan 18, 2023 07:22 AM
Hi all!
I'm very new to scripting and I have this code that was working before until recently. When I run the code I see
at main on line 271
Line 271 is
let client_apps = globals.site.getCellValue("Apps")
var globals = {}
let client = await input.recordAsync("Which client has a change?", base.getTable("📊 Clients"));
const sitesTable = base.getTable("🌐 Sites");
const sitesQuery = await sitesTable.selectRecordsAsync({fields: ["Apps", "Client", "Site Name", "Site Type", "Status"]});
// Does the client have multiple OTT sites? If so, we'll need to know
// which app suite the change applies to
// Get all the client's Site records
var clientSites = sitesQuery.records.filter(record => record.getCellValue("Client") && (record.getCellValue("Client")[0].id === client.id));
// Only proceed with the OTT sites
var clientSites = clientSites.filter(record => record.getCellValueAsString("Site Type").includes("OTT") && record.getCellValueAsString("Status") == "ON");
if (clientSites.length > 1) {
globals.site = await input.recordAsync("This client has more than 1 OTT site. Which site's apps need a change?", clientSites)
} else {
globals.site = clientSites[0]
}
When I run the code I get all the way past choosing a specific record from the "sites" table but when I get to the "getCellValues" it's showing that TypeError.
I can confirm that cell isn't empty and should have the records linked to that cell as per the ss I attached.
Any help at all would be appreciated!
Jan 21, 2023 05:24 PM
Hm, the fact that it was working before but suddenly stopped working really makes it feel like a data issue, but as you've shown in the screenshot that field isn't empty and so this error shouldn't be appearing
Any chance you could duplicate the base, clear out any private data and share access to it so I could take a crack at debugging?