Passer au contenu principal
Back to use cases
Google Forms Sheets Apps Script Gmail Drive

Multi-level approval workflow with Google Forms and Apps Script

Three-level spending request, mandatory reason for rejection, automatic reminders after 48 hours and a PDF purchase order, with no third-party licence.

Level : Intermediate

The need

Google Forms collects answers but cannot route a request from one approver to the next. This case builds a state machine around Google Sheets and an Apps Script web app, without sharing the spreadsheet with approvers.

The workflow at a glance

  1. Requester

    Enters the need, category and amount in the form.

  2. L1 — Manager

    Assesses whether the expense makes operational sense.

  3. L2 — Financial control

    Checks budget availability and cost allocation.

  4. L3 — Management

    Gives final financial approval.

  5. Purchase order

    PDF generated in Drive and sent to the requester.

Functional architecture

The workflow keeps three roles apart: input (Google Forms), state storage (Google Sheets) and orchestration (an Apps Script web app). Each request goes through the three approval levels in order; a rejection at any level closes the file.

StepActorAssigned byChecksTriggered action
StartRequesterEmail collected by FormsNeed, category, amountCreates the UUID token, notifies L1
Level 1Line managerEntered in the form (col. F)Does the expense make sense?Approves (to L2) or rejects with a reason
Level 2Financial controlFixed setting (CONFIG_NIVEAUX)Budget and allocationApproves (to L3) or rejects with a reason
Level 3Senior managementFixed setting (CONFIG_NIVEAUX)Final financial approvalGenerates the PDF purchase order and closes

Data model in Google Sheets

Once the form is linked to the spreadsheet, columns A to F receive the answers. Nine technical columns (G to O), added in row 1, let the script know the exact state of each file. Headers stay in French, as the script reads them as written.

Col.Exact headerSourceRole
AHorodateurFormsSubmission date and time
BAdresse e-mailFormsRequester, recipient of notifications and of the PDF
CIntitulé de la dépenseFormsSubject of the purchase request
DCatégorieFormsHardware, Software, Travel, Service
EMontant TTC (€)FormsAmount printed on the purchase order
FE-mail Manager N1FormsFirst approver, chosen by the requester
GTokenApps ScriptUnique identifier (UUID v4) that authenticates action links
HÉtape ActuelleApps ScriptState cursor: 1, 2, 3 in progress, 0 closed
IDécision N1Apps ScriptPending, Approved or Rejected
JDécision N2Apps ScriptPending, Approved, Rejected or Cancelled
KDécision N3Apps ScriptPending, Approved, Rejected or Cancelled
LStatut GlobalApps ScriptReadable summary for administrative follow-up
MMotif du refusApps ScriptMandatory justification when rejected
NDernière actionApps ScriptReference timestamp for 48-hour reminders
OBon de commande PDFApps ScriptDrive link to the document generated after L3 approval

Engineering and security principles

  • Idempotence and order control (level !== etapeActuelle): each action link carries the UUID token and the expected level. A double click, or L3 acting before L2, is blocked by comparing it with the "Étape Actuelle" column.
  • Least privilege: deployed as "Execute as: Me", the app writes to the spreadsheet and to Drive while no approver has access to them.
  • Concurrency (LockService): a 10-second exclusive lock protects each read-write, so that two simultaneous clicks cannot corrupt a row.
  • Client-server exchange (google.script.run): the "Reject" button opens an HTML form whose submission calls the server function enregistrerRefus() to store the reason and close the workflow.
  • Response time (48 h): a time-driven trigger checks column N. After 48 hours without action, the approver gets a reminder and the timestamp is reset, spacing reminders 48 hours apart.

Step-by-step deployment

  1. Prepare Google Forms: turn on "Collect email addresses", then create the 4 questions in the order of columns C to F (Title, Category, Amount incl. VAT, L1 manager email).
  2. Set up Google Sheets: link the form to a spreadsheet and type the 9 technical headers in cells G1 to O1.
  3. Install the code: open Extensions > Apps Script, paste the script, fill in the L2 and L3 emails, then save.
  4. Publish the web app: Deploy > New deployment > Web app, "Execute as: Me", "Who has access: Anyone". Copy the /exec URL into the WEB_APP_URL constant, then publish a new version (Manage deployments).
  5. Turn on both triggers (alarm clock icon): onFormSubmit, from spreadsheet, on form submit; relancerValidationsEnAttente, time-driven, every 6 hours.
Google Workspace + Gemini partner offer

Upgrade to Google Workspace Business with your custom domain and built-in Gemini AI

Get a 14-day free trial and a discount on your first year of Google Workspace Business (professional Gmail, secure Drive, Meet, Docs, Sheets, and built-in Gemini AI).

FF

Fabrice Faucheux

Google Workspace, Apps Script & AI Expert (Brittany, France)

Developer and trainer specialized in Google Workspace automation, custom add-ons (Google Sheets, Docs, Gmail), and AI integration (Gemini, Claude).

Updated on

$bordureSectionCl = $monetisationDansCl  ? ($estSombreCl ? 'pt-10 border-t border-slate-800/80' : 'pt-10 border-t border-slate-200/80')  : 'pt-2'; ?>
AI & Google Workspace resource center

You might also like...

Continue your exploration with these custom-built applications.