A Small Reservation System Built with Google Calendar and Google Forms: GAS095
Introduction
In this project, I present a compact and complimentary reservation system crafted using the combined capabilities of Google Calendar and Google Forms. This system empowers you to manage events within a calendar, and through the potency of Google Apps Script, these events are seamlessly synchronized to a Google Forms platform. This enables your users or clients to effortlessly reserve slots, streamlining the booking process.
YouTube
If you're a visual learner and prefer watching video instructions, I highly recommend checking out this video.
Instructions (5 Steps)
To establish your own project, adhere to the following steps:
Step 1
Utilizing the provided link, you can create a duplicate of my project on your Google Drive.
Step 2
To meet the authorization requirements, open the copied Google Forms document. In the add-on menu, locate the custom menu named "Reservation." Within this menu, select any of the available buttons.
* Check the authorization guide if unfamiliar with the process.
A Complete Guide to Authorize GAS Project
Step 3
Once you have obtained authorization, proceed to open the Apps Script editor. To do this, navigate to the "More Button (...)" in the copied Google Forms and select "Script Editor." Subsequently, you will need to replace the existing calendar named "Booking" with a different calendar from your Google account. This calendar will serve as the medium for managing your booking events.
Step 4
Implement triggers to ensure that whenever there is a modification in the Google Calendar or a new submission is made, the corresponding events in the form are updated accordingly.
Step 5
After the trigger installation, you can go to the calendar which you set in step 3. Create a test event with a title with below format, it should trigger the script to update the dropdown list in the Google Forms.
Title (#/#) - In the event title, the number before the forward slash ("/") represents the current number of guests attending, while the number after the forward slash represents the maximum number of guests allowed. Ensure that both numbers are enclosed within parentheses. For instance, Table A (0/10) has a maximum capacity of 10 people to book.
With the latest events from the calendar, the script will provide updates to the elements within the Google Forms.
Other Features
- To understand my code, open the Apps Script editor. To do this, navigate to "Extensions" in the menu bar, and then select "Apps Script.”
- Within the "Reservation" custom menu, you can manually update events in Google Forms. Additionally, you have the option to disable the automated process by deleting the triggers.
- In the app configuration object, you have additional options available.
const CONFIG = {
APP_NAME: "🍕 Reservation",
CALENDAR_NAME: "Booking",
CALENDAR_COLOR: '#EAAA47',
EVENT_COLOR: {
OPEN: CalendarApp.EventColor.GREEN,
FULL: CalendarApp.EventColor.GRAY,
},
DAYS_START: 0,
DAYS_END: 7,
TITLE: {
EMAIL: "Email",
RESERVATION: "Reservation",
},
NO_RESERVATIONS: "Sorry, no reservations!"
}
GoogleAppsScript Playlist (Subscribe for New Projects)
Links
Hire me on Upwork Donate (PayPal) YouTube Github Twitter / X Instagram
Comments
Post a Comment