A leave calendar system that I implemented for my ex-team when i was learning how to use Google App Scripts. Also uses Google Forms, Sheets and Calendar
Disclaimer: This is a fun project done when i was new to programming, please dont judge me on this!
The leave calendar's "frontend" is a Google form that allows users to enter their names, leave's start date, end date, reason, and if they are creating a new entry or deleting a previous leave record.
The backend "Database" is on Google Sheets. It is linked to the form and records all responses there.
The backend "logic" is on Google App Script. It is linked to the sheet and is triggered on form submit.
- Create a new Google Calendar
- Go to Settings and Sharing and get its Calendar ID
- Should look something like this [email protected]
- Create a form like this
- Create spreadsheet on the RESPONSES tab of the form to link it
- Note down the Sheet ID from the url of the Google Sheet e.g. https://docs.google.com/spreadsheets/d/1JiyR3mgaekPijSsW8UGk-HJayYLBPkesOqKVYv3QD2g/edit#gid=308592446
- The Sheet ID should then be: 1JiyR3mgaekPijSsW8UGk-HJayYLBPkesOqKVYv3QD2g
- Edit the spreadsheet so that it looks like this, with 2 sheets named records and events. The columns headers and order are extremely important
- Go to Tools and click on Script Editor. This will open up the Google App Script editor.
- Create a new script file and copy paste the entire Code.gs into it
- Update CALENDAR_ID with Calendar ID from step 1
- Update SPREADSHEET_ID with Sheet ID from step 3
- On current project triggers, set
- Run - onSubmit
- Events - From spreadsheet and On form submit
- Done!