O'Reilly logo

Learning Google Apps Script by Ramalingam Ganapathy

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating a ticket reservation application

This application serves as an HTML form to the user to let them submit values to the server. This could be to reserve a ticket for a show, book a seat in a venue, book a room in a hotel, and many more purposes.

Create a spreadsheet and create column labels as shown in the following screenshot:

Creating a ticket reservation application

In the code file, create the doGet, doPost and cancelReservation functions:

function doGet(e) { // Maximum available const MAX_TICKETS = 25; // 'cancel' is a query string appended with the published URL. var cancel = e.parameter.cancel; if(cancel){ var msg = cancelReservation(cancel); return ContentService.createTextOutput(msg); ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required