Skip to main content

My script runs as an automation when the user clicks a button on an interface page.

If the script fails, I log an error to the console, and I can find the error in the run history. But it would be nicer to display a message to the user if they are still on the interface page. Is that possible? Thanks!

​Hi ​@Jean_Thoensen,

I hope you’re doing well. I noticed this has gone unanswered for too long. You can definitely do what you are describing but maybe a bit differently. If a script simply errors out, it will end at the line where it encountered an issue. At this point your automation will end. What I would recommend is to make sure your script has proper try and catch logic that will actually not end the script if it encounters an issue, instead you can tell it to output an error message. Not sure what your script does for it to fail at times, but it could be that you’re fetching an API or passing an empty array that then your script runs into undefined errors. You could put in error handling in your script to output specific error messages. 
 

Once you get that working you can have a conditional step in your automation that would save that error message into a records field. Then in your interface you could have that records field be displayed next to the button, so if there is an error, the user can see it or if there is no error then nothing shows up. Or you could also always show a message there like for example while the automation is running you have it say Loading…, and then once it’s been completed successfully you can display a success message. 
 

Not sure if you still need to make this work, but if you share your script and give me a few examples of when it failed, I could help with some error handling!

 


Hmhh this is an interesting request though. An error on the script could potentially show a very small banner with an Error message with a hyperlink to the execution run at least. If still interested (this was a very long time ago) you could have this submitted as a feature request using this form.

Mike, Consultant @ Automatic Nation