Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Server response handlers for google.script.run

How do I specify BOTH a success AND a failure handler for the same server call with google.script.run?

like image 791
skyser5 Avatar asked Aug 09 '12 08:08

skyser5


People also ask

How do you trigger an onEdit in Google Sheets?

The onEdit(e) trigger runs automatically when a user changes the value of any cell in a spreadsheet.

How do I handle GET and POST HTTP requests in Google Apps Script?

Handle POST Requests with Google ScriptsThe callback function doPost is invoked when an HTTP POST request is make to your Google Script URL that is published as a web app with anonymous access. const doPost = (request) => { console. log(request); return ContentService. crateTextOutput(JSON.


1 Answers

The following code should do what you need

google.script.run.withFailureHandler(myFailureHandler).withSuccessHandler(handler1);

It is documented in the Success and Failure Handlers paragraph. The text starts with

You can use any combination of withSuccessHandler, withFailureHandler, and withUserObject.

like image 115
megabyte1024 Avatar answered Nov 15 '22 09:11

megabyte1024