Skip to content

Latest commit

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Multi-Step Form Builder — Google Apps Script

A fully dynamic, settings-driven multi-step form built with Google Apps Script and React 18. Every field, step, and option is configured directly from a Google Sheet — no code changes, no redeployment.

Developed by Rameez Scripts · YouTube · WhatsApp


Features

FeatureDetails
Settings-DrivenAdd/remove fields and steps by editing the Settings sheet — zero code changes
Multi-Step NavigationStep indicator with completed/active/pending states
Step-by-Step ValidationRequired fields, email format, file presence checked per step
Review Before SubmitDedicated review screen showing all answers before final submission
11 Field Typestext, email, tel, number, date, textarea, select, radio, checkbox, image, file, dependent_select
Dependent DropdownsCascading selects — child options filter based on the selected parent value
Image & File UploadFiles uploaded to Google Drive; image URLs use the fast lh3.google.com CDN
Duplicate Email DetectionReal-time check on blur — blocks Next if email already exists in Responses
Email NotificationsConfirmation email to submitter + admin alert email with full HTML summary
Custom Success ScreenConfigure success title and message from the Config sheet
Responses in SheetsEach submission appended as a row; headers auto-created from active fields
Mobile ResponsiveOptimised for all screen sizes — 360px to desktop
Skeleton LoaderSmooth skeleton UI while form config loads

Project Structure

├── Code.gs ← Apps Script backend (all server-side logic)
└── index.html ← Single-file React 18 frontend (HTML + CSS + JS)

Only two files. No build tools, no npm, no dependencies to install.


Quick Start

1. Create a Google Spreadsheet

Open Google Sheets, create a new spreadsheet, and name it anything you like (the name is used as the Drive upload folder name automatically).

2. Open Apps Script

Go to Extensions → Apps Script in your spreadsheet.

3. Copy the Files

  • Paste Code.gs contents into the default Code.gs file.
  • Click +HTML → name it index → paste index.html contents.

4. Run setupDemoData

In the Apps Script editor, select the setupDemoData function from the dropdown and click Run. This will:

  • Create the Config sheet with default settings
  • Create the Settings sheet with a 4-step demo form (including a dependent dropdown example)
  • Create the Responses sheet with 5 sample responses

5. Deploy as Web App

  1. Click Deploy → New Deployment
  2. Select type: Web App
  3. Execute as: Me
  4. Who has access: Anyone (or Anyone within your domain)
  5. Click Deploy → copy the web app URL

Your form is live. Open the URL to see it in action.

Note: Any time you change Code.gs, you must create a New Deployment (not just save) to get the updated URL.


Sheet Reference

Config Sheet

Controls app-level settings. Add rows in key / value format.

KeyDescriptionExample
admin_emailEmail address to receive admin alerts on every submissionadmin@example.com
success_titleHeading shown on the success screen after submitThank You!
success_messageBody text shown on the success screenWe will be in touch shortly.

Leave admin_email blank to disable admin notifications.


Settings Sheet

Each row defines one field. The form is fully rebuilt from this sheet on every load.

ColumnNameDescription
Afield_idUnique numeric ID for the field
BstepStep number (1, 2, 3…)
Cstep_labelLabel shown in the step indicator
Dfield_nameInternal name used as the key in Responses (no spaces, use underscores)
Efield_labelLabel displayed to the user
Ffield_typeField type — see Field Types
GoptionsComma-separated options (select/radio/checkbox) or pipe-separated map (dependent_select)
HrequiredYes or No
IplaceholderPlaceholder text
JorderSort order within the step (1, 2, 3…)
KactiveYes to show, No to hide
Ldepends_onFor dependent_select — the field_name of the parent field

To add a new field: insert a new row with active = Yes. No redeployment needed — reload the web app.

To disable a field: set active = No. The field disappears from the form and is excluded from new responses.


Responses Sheet

Auto-generated on first submission. Each row is one form submission.

ColumnDescription
response_idAuto-incrementing integer ID
submitted_atISO 8601 timestamp (2026-04-11T09:22:14.000Z)
(field columns)One column per active field, in the order they appear in Settings

Headers are created automatically on first submit. If you add new fields later, new columns are appended to the right.


Field Types

TypeDescription
textSingle-line text input
emailEmail input with format validation + real-time duplicate check
telPhone number input
numberNumeric input
dateDate picker
textareaMulti-line text area
selectSearchable dropdown (single select)
radioRadio button group — single choice
checkboxCheckbox group — multiple choices (stored as comma-separated)
imageImage upload → Google Drive → lh3.google.com CDN URL stored
fileAny file upload → Google Drive view link stored
dependent_selectCascading dropdown — options change based on a parent field's value

Dependent Dropdown

A dependent_select field shows different options depending on what was selected in a parent field.

Settings row example:

field_namefield_typeoptionsdepends_on
industry_roledependent_selectTechnology:Developer,DevOps Engineer|Healthcare:Doctor,Nurse|Finance:Analyst,Accountantindustry

Options format:

ParentValue1:option1,option2,option3|ParentValue2:option4,option5|ParentValue3:option6
  • Segments separated by |
  • Each segment: ParentValue:comma,separated,options
  • The child dropdown resets automatically when the parent value changes
  • When no parent is selected, the child shows a "Select [parent field] first" placeholder

Email Notifications

Two emails are sent automatically after every successful submission:

Confirmation Email (to submitter)

  • Sent to the value entered in the email field (if the form has one)
  • Subject: Submission Confirmed — Ref #[ID]
  • Body: Navy Blue header + HTML table of all field answers

Admin Notification

  • Sent to the admin_email configured in the Config sheet
  • Subject: New Form Submission — Ref #[ID]
  • Body: Same HTML table format with a reference ID callout

Both emails are sent via MailApp (uses the Google account that deployed the script). File/image field values are replaced with [Uploaded File] in the email body — the actual URL is stored in Responses.

Google Apps Script has a daily email quota (100 emails/day on free accounts, 1500/day on Workspace). Plan accordingly for high-volume forms.


Duplicate Email Detection

When a user fills in an email field and moves focus away (on blur), the app silently calls the backend to check if that email already exists in the Responses sheet.

  • Checking: spinner shown under the field
  • Duplicate found: red warning — "This email is already registered" — the Next button is blocked
  • Available: green checkmark shown
  • On change: status resets immediately so the user can try a different email

The check is case-insensitive and trims whitespace. If the Responses sheet is empty or has no email column yet, it returns available.


File & Image Upload

Files are uploaded to Google Drive using the base64Blob pattern:

  1. User selects a file — FileReader converts it to base64 in the browser
  2. On submit, base64 is sent to uploadFile() in Code.gs
  3. The file is created in a Drive folder named after your spreadsheet (auto-created if it doesn't exist)
  4. The file is shared as Anyone with the link → View
  5. The Drive URL is stored in the Responses sheet:
    • Imageshttps://lh3.google.com/u/0/d/[fileId] (fast CDN, renders in browser)
    • Other fileshttps://drive.google.com/file/d/[fileId]/view

File size limit: 10 MB per file (enforced client-side before upload).


Customisation

Adding a New Step

In the Settings sheet, add rows with a new step number (e.g., 5) and a new step_label. The step indicator updates automatically.

Changing Step Order

Update the step numbers. Fields are sorted by step then order.

Hiding a Field Temporarily

Set active = No. The field is excluded from the form and from new response columns. Existing data in Responses is not affected.

Renaming Field Labels

Edit the field_label column — labels update on next form load. Do not change field_name after data has been collected, as it maps to the Responses column header.

Reordering Fields Within a Step

Update the order column values.


Tech Stack

LayerTechnology
BackendGoogle Apps Script (V8 runtime)
DatabaseGoogle Sheets
File StorageGoogle Drive
EmailMailApp (Apps Script built-in)
FrontendReact 18 (CDN + Babel)
IconsFont Awesome 6.5.1
AlertsSweetAlert2
HostingGoogle Apps Script Web App

No server, no database setup, no hosting costs — everything runs on Google infrastructure.


Permissions Required

When you deploy and first run the app, Google will ask you to authorise:

PermissionUsed For
Google SheetsRead Settings/Config, write Responses
Google DriveCreate upload folder, upload files
Gmail (MailApp)Send confirmation and admin emails

Troubleshooting

Form shows a loading skeleton forever

  • Check that setupDemoData ran successfully and the Settings sheet exists.
  • Open Apps Script → Run getFormConfig manually and check the Execution Log for errors.

Files not uploading

  • Make sure Drive permission was granted during authorisation.
  • Check the 10 MB limit — larger files are blocked client-side.

Emails not sending

  • Verify admin_email in the Config sheet has a valid email address.
  • Check the Gmail quota (100/day free, 1500/day Workspace).
  • Open Apps Script → Execution Log — email errors are logged but don't fail the submission.

Changes to Code.gs not reflected

  • You must create a New Deployment, not just save the file.

Duplicate check always shows "available"

  • The Responses sheet must have a header row with a column named exactly matching the field_name of the email field (default: email).

Developer

Rameez Scripts — Custom Google Apps Script & PHP/MySQL Solutions


License

This project is licensed under the MIT License — free to use, modify, and distribute.

About

Dynamic multi-step form builder with Google Apps Script & Sheets — settings-driven fields, Drive file upload, email notifications, real-time duplicate detection & dependent dropdowns

Topics

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages