Putting client uploads in Google Drive is easy when every file is handled by one person. Once a form collects dozens of files, the difficult part becomes choosing the right destination reliably. A customer might type “Avenue Repair” one week and “Ave. Repair LLC” the next. If the automation creates folders from that free-form name, the history splits and sensitive material can land in the wrong place. Let the form collect the submission, but let an internal client registry determine the folder.

This guide adapts Google’s Forms-to-Drive Apps Script sample for a US small business. It focuses on routing, permissions, retry behavior, and tests. The sample demonstrates the trigger and upload mechanics; the client registry and control process below are an architecture to build and test, not a turnkey Google feature.

Link each response to one client and one approved folder

Create an internal registry with a stable client code, display name, and the Drive folder ID for that client. A fictional entry could be CLI-014, Avenue Repair LLC, and the ID from the approved Drive folder URL. The code stays the same even when the business changes its display name. A submission with an unknown, duplicate, or empty code should enter a review queue. It should never create a fresh client folder based on the supplied text.

Registry fieldPurposeExample
Client codeStable lookup keyCLI-014
Display nameReadable label for staffAvenue Repair LLC
Approved folder IDDestination selected by the businessID copied from the Drive folder URL
StatusWhether uploads may be routedActive or hold

A code typed into a form is an operational lookup, not proof of identity. A prefilled link also does not establish who used it. If routing depends on an authorized sender, check identity using your approved account or client process before releasing a file into a destination shared with anyone else. Keep the form’s initial upload area separate from client-facing folders. Drive permissions can be inherited, so check who can see a newly copied file at each destination.

Build a test form with fictional documents

Start with a Google Form containing a required client code, document type, and file-upload question. Restrict file types, count, and size according to your process. Test it with an account equivalent to the real external sender. Google Workspace domain policies or login requirements may prevent that account from submitting. Discover that before publishing a link to customers. If the intended audience cannot upload, choose a different approved intake channel; a script cannot process a response the form never accepted.

Link responses to a restricted Google Sheet if your team needs a visible intake log. Use a separate tab for processing states rather than editing the raw response data. For each received file, record response ID, source file ID, client code, document type, received time, destination folder ID, destination file ID, status, and last error. Staff should be able to distinguish “received” from “verified and filed.”

Use Google’s sample as the trigger foundation

In a test form, open Apps Script and review the official upload and organize sample. Its setup function creates a folder and an installable form-submit trigger. Its handler reads the response and routes uploaded files into a subfolder selected by a form field. Keep the event and file-reading concepts, but replace the user-selected destination with a lookup in your internal registry.

Set up the script using the designated operational Google account. Run the setup function and confirm the trigger exists before testing a submission. Google’s installable-trigger documentation explains that such triggers run under the account that created them. Give that account access to the form, registry, intake folder, and only the destinations it needs. When an employee leaves, transfer operational ownership and recreate or review triggers before removing their access.

A form-bound submit trigger and a spreadsheet-bound submit trigger provide different event objects. Use the event structure expected by the sample you actually installed. Do not paste form-event code into a spreadsheet trigger and assume that the response objects are identical.

Resolve the folder through the registry

For a form-bound implementation, the handler can read the item responses, find the uniquely titled client-code field, normalize the code, and search an internal registry. Require exactly one active match with a nonempty folder ID. Then use Drive access under the trigger account to open the destination. If lookup or access fails, record a pending item and stop before copying files. Record a clear error, but avoid putting sensitive names or file contents into broad logs.

The registry should be writable only by authorized staff. Validate the destination folder ID when adding a client and whenever access changes. Do not allow the form respondent to submit a raw folder URL. That would turn an intake form into a user-controlled routing mechanism. A document category such as “tax,” “contract,” or “onboarding” may help staff sort files, but the customer should not see a list of other clients’ folder names.

During a pilot, copy the uploaded file to the destination rather than moving it. That leaves the intake original available for comparing contents and retrying after a failure. When the copy is confirmed and the retention policy allows cleanup, remove old intake files in a controlled process. If your production design uses moves, account for the changed location and access rights before enabling it.

Make each attachment safe to retry

One form response can contain several files. Use the response ID plus the source file ID as the processing key and keep a separate state for each attachment. If the first two files succeed and the third fails, a retry should handle only the third. A later submission can have the same filename; the file ID distinguishes it from the earlier document.

A copy can succeed while the script fails before writing “complete” to the log. Define how a retry searches for an already created destination file before making another copy. Record the confirmed destination file ID. If two executions can act on the same queue record, use a lock or another concurrency control around the state transition. Google documents Apps Script’s Lock Service for preventing concurrent access to a critical section. A lock helps protect the record update; it does not by itself make Drive copies idempotent.

Give every pending state a readable reason: unknown client code, missing folder permission, file read error, copy not confirmed, or identity review required. A staff member should know which item to retry and which needs a human decision. Do not silently mark an entire response successful when one of its attachments failed.

Test real operational failures before rollout

  1. Submit two fictional files for a valid client. Open both from the approved destination and compare their names, sizes, and content with the test originals.
  2. Submit an unknown or duplicate client code. Confirm that a pending record appears and no client-facing folder receives the files.
  3. Remove destination access for the trigger account in a test folder. Confirm the error is visible, restore authorized access, and retry only that item.
  4. Process the same source file twice through the retry path. Confirm the destination contains one intended copy.
  5. Open a client folder with a client-equivalent test account. Verify that account sees the intended material and cannot reach another client’s documents.
  6. Submit a corrected document with the same filename as an earlier version. Confirm the two files remain distinguishable and the newer one is not automatically treated as approved.

Track daily counts of files received, filed, and pending. If those counts do not reconcile, inspect the response and source file IDs rather than rerunning everything. Review the Apps Script execution history alongside the team queue; a failure to write the queue itself may appear only in execution logs.

Handle corrections without erasing the history

When a client sends a revised agreement or corrected tax form, link both submissions in the control record. Mark the new item “under review” until a person confirms which version should be used. Do not replace an accepted document automatically just because the filename matches. Retain the earlier version according to the business’s document policy, with access appropriate to its sensitivity.

Test this path deliberately: two responses, the same document type and filename, and different contents. Staff should be able to open both, identify which arrived later, and see which was approved. That is easier when the log uses stable IDs and explicit version state rather than relying on names alone.

Questions before choosing the tool

Can the client choose the destination folder?

Let the client choose a document category if helpful, but resolve the actual folder from your restricted registry after checking the submission. Do not expose other clients’ destinations.

When should I use another automation platform?

If files arrive from several systems or multiple teams need to operate a queue, evaluate how a candidate platform handles credentials, logs, retries, file IDs, and access. Keep the response-to-file-to-client relationship no matter which tool performs the work.

What if external clients cannot use the upload question?

Test the form with the same type of external account as your customers. If its sign-in or domain restrictions block them, settle on a different authorized intake method before building the routing automation.

Begin with a predictable destination

A small pilot needs one form, a restricted registry, a clear pending queue, and fictional files that exercise failure paths. Once staff can reconcile every received attachment with a confirmed destination or an explainable pending state, expand the workflow. The goal is not merely to move files faster; it is to know exactly whose document was received, where it went, and what happens when the happy path fails.

Sources and references