Answer the question
In order to leave comments, you need to log in
How to catch an error in the onSubmit trigger and display it in the form?
Hello, I set up a trigger in google forms via google scripts so that the data from the form is sent by a post request. But sometimes on the server where I send the data, an error occurs. Now I can see these errors only by opening google scripts in the "Number of executions" tab.
How to catch the error and display it in the form itself so that I immediately understand that the data was not sent. and there was an error?
Answer the question
In order to leave comments, you need to log in
As far as I know, in Google Forms it will not be possible to get a UI to show something
Note that in Google Forms, user-interface elements are visible only to an editor who opens the form to modify it, not to a user who opens the form to respond.
function onSubmit(e) {
try{
// Что-то делаем
throw "Тут происходит ошибка";
}catch(err){
FormApp.getActiveForm().setConfirmationMessage(`Ошибка! ${err}`);
};
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question