Hi All,
I'm wondering if there is a way to get an automation's name from within the automation.
I'm working on a better error handling system for collaborative bases. When automations fail, they currently only send a notification to a single user - the person who turned the automation on or updated it last. I need multiple people to be informed in a non-arbitrary way should any one of the developers be out.
I currently have something that looks like this:
output.set("update_status","success");
let buildErrMsg = function(automationName, description, name ){
let msg = description + " in " + automationName + ".\n\n" + "Failed with error: " + name
return(msg)
}
try{
await table.updateRecordsAsync(recordsToUpdate)
}catch(err){
err.description = "Issue with updateRecordsAsync";
err.automationName = "My Automation"
let msg = buildErrMsg(err.automationName,err.description, err.name)
output.set("update_status",msg);
}
The output variable is then used to send a slack message to the team handling base development.
Ideally, the `automationName` variable could be dynamically assigned based on the current automation.