AFI AFI

Google Drive

Estimated reading: 3 minutes Updated August 1, 2026

Google Drive is Google’s file-storage and collaboration service. Advanced Form Integration creates a new file in your Google Drive for every form submission, useful for archiving submissions as JSON/CSV, saving form-uploaded files, or piping data into a shared team folder.

What you’ll need

  • A Google account with Drive access.
  • A Google Cloud project with the Drive API enabled and an OAuth client.
  • The Advanced Form Integration plugin installed and activated.

Set up the Google Cloud project

Same flow as Google Sheets and Google Calendar. Google requires you to create your own OAuth client.

  1. Go to the Google Cloud Console.
  2. Create a new project (or use an existing one).
  3. APIs & Services → Library → search for Google Drive APIEnable.
  4. APIs & Services → OAuth consent screen → set up as External (personal) or Internal (Workspace). Add scope https://www.googleapis.com/auth/drive.file (limited to files created by the app, recommended) or drive (full access).
  5. APIs & Services → Credentials → Create Credentials → OAuth client ID → Web application.
  6. Paste the redirect URI shown in AFI → Settings → Google Drive under Authorized redirect URIs.
  7. Copy the Client ID and Client Secret.

Connect Google Drive to AFI

  1. In WordPress, go to AFI → Settings → Google Drive.
  2. Click Add Account, paste the Client ID + Client Secret.
  3. Click Save & Authorize, sign in to Google, grant access.
  4. AFI shows Connected.

Create the integration

  1. Go to AFI → Add New.
  2. Configure the trigger.
  3. In Action → Platform, select Google Drive.
  4. In Task, choose Upload File.
  5. Map the fields:
  • Folder: pick the destination folder from the dropdown (or root).
  • File Name: use Mixed Field tokens (e.g. submission-{entry_id}.json).
  • File Content: text body to write, or a Mixed Field that includes form data.
  1. Optional: configure Conditional Logic.
  2. Click Save Integration.

Screenshot: AFI Add New screen with Google Drive selected, folder dropdown populated, file name and content fields visible

Use cases

  • Submission archive: write each submission as a text or JSON file to /submissions/.
  • CSV export: daily roll-up of submissions.
  • Form file mirror: pipe uploaded files into a shared Drive folder.

Conditional logic example

Goal: archive only paid orders to Drive, skip free signups.

Open Conditional Logic, add a condition with the order total field, Greater Than, value 0.

Troubleshooting

File not created

  • invalid_grant: token expired. Re-authorize in AFI Settings.
  • quotaExceeded: Drive storage is full or API quota hit.
  • insufficient permissions: the OAuth scope was too narrow. Use drive.file for app-created files or drive for full access.

Uploaded files don’t appear

If you used the drive.file scope, AFI can only see/manage files it created. That’s normal. Broader scope (drive) lets you see all files at the cost of asking for full access.

Related docs