Help

Re: Get automation name from within automation

Solved
Jump to Solution
783 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Collin_Schwante
5 - Automation Enthusiast
5 - Automation Enthusiast

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. 


1 Solution

Accepted Solutions
kuovonne
18 - Pluto
18 - Pluto

Scripting does not have access to the automation name. You can add input variables for the automation name and url so that you do not have to hardcode them into your script. Set the input variables when you configure the automation, and reference the input variables inside the script.

See Solution in Thread

2 Replies 2
kuovonne
18 - Pluto
18 - Pluto

Scripting does not have access to the automation name. You can add input variables for the automation name and url so that you do not have to hardcode them into your script. Set the input variables when you configure the automation, and reference the input variables inside the script.

Collin_Schwante
5 - Automation Enthusiast
5 - Automation Enthusiast

Thanks! That will be cleaner than having them in the script. Should definitely include the url to make it easier to get back to the automation.