Salesforce · Google Drive · File Integration

Salesforce Google Drive Integration: Files Connect, Custom Builds and Secure Setup

Proposals, contracts and client files usually live in Google Drive, while the customer lives in Salesforce. Here are the ways to connect the two in 2026, how to set up Salesforce Files Connect step by step, when a custom build is worth it, and the limits, scopes and permissions that decide whether the integration holds up.

Key Takeaways

  • Salesforce's own route is Files Connect: users browse, search and share Google Drive files from Salesforce, without code, in Professional, Enterprise, Performance, Unlimited and Developer editions.
  • Files Connect works with each user's personal My Drive only. It does not support Google Drive shared drives, which many companies use for team and client folders.
  • A custom integration (Lightning Web Component, Google Picker, Drive API and named credentials) adds record folders, shared drives and automated uploads, but has to respect Apex callout limits.
  • Files over 5 MB should use Google's resumable upload, sent in chunks from asynchronous Apex. Callouts are capped at 6 MB synchronous and 12 MB asynchronous.
  • Scope choice matters: drive.file is non-sensitive, while full drive access is restricted and can trigger Google's annual security assessment.

What is a Salesforce Google Drive integration? It is any connection that lets people find, attach, open or upload Google Drive files from Salesforce records, so documents stay in Drive while the customer, deal or case stays in Salesforce. The standard option is Salesforce Files Connect. Custom builds use the Google Drive API and Google Picker for record-level folders and automation, and Data 360 can ingest Drive files for AI.

We first published this guide in 2020 with a single Visualforce and Google Picker example. That code relied on Google's sign-in library, which Google deprecated in March 2023, and it placed keys in page code. This version replaces it with the current options, checked against Salesforce and Google documentation in November 2026. It is written for operations, IT and sales leaders at growing and mid-market companies whose teams already work in Google Workspace, and for the admins and developers who will set the integration up.

Section 01 · Short Answer

How Do You Connect Google Drive to Salesforce?

Start with Salesforce Files Connect if people mainly need to find and share Drive files from Salesforce. Move to a custom build when you need a Drive folder per record, shared drives or automatic uploads. Files Connect is configuration only. A custom build is development work, but it gives full control over folders, permissions and large files.

Files Connect

Salesforce's built-in connector. Browse, search and share My Drive files as copies or references, with no code.

Custom build

A Lightning Web Component with Google Picker and the Drive API, authenticated through named credentials, for record folders and automation.

Data 360 connector

Ingests documents from Google shared drives into Data 360 so AI use cases can draw on them. Not a file panel for users.

Section 02 · Why Integrate

Why Integrate Salesforce and Google Drive?

Three reasons: one place to find documents, less time switching between apps, and lower Salesforce file storage use. Without an integration, reps download files from Drive and re-upload them to records, or paste links into notes that nobody can search. Copies drift out of date, and Salesforce file storage fills with duplicates of documents that already live in Drive.

Storage is the reason that most often triggers the project. Salesforce file storage covers attachments, Files home, Salesforce CRM Content, Chatter files and the Documents tab, and the allowance is fixed by edition:

Salesforce editionFile storage per orgAdded per user licence
Enterprise, Performance, Unlimited10 GB2 GB
Contact Manager, Group, Professional10 GB612 MB
Essentials and Starter1 GBNot listed

Source: Salesforce Help, data and file storage allocations and file storage. Extra storage, and Salesforce Archive, are bought separately. A Drive integration that references files instead of copying them keeps documents out of that allowance.

The other benefits are practical. Everyone works on the current version in Google Docs, Sheets or Slides rather than an attached copy. Colleagues who do not use Salesforce, such as finance or delivery teams, keep working in Drive. And with the right setup, the file sits next to the record it belongs to, so the next person to open the account can find it.

Section 03 · Options

What Are the Ways to Connect Google Drive to Salesforce?

There are four official or standard routes, and they solve different problems. Files Connect and a custom build put Drive files in front of Salesforce users. The Data 360 connector feeds Drive content to AI and data use cases. Google's Data connector for Salesforce works the other way round, bringing Salesforce data into Google Sheets.

QuestionFiles ConnectCustom buildData 360 Drive connectorSheets Data connector
Main jobBrowse, search and share Drive files in SalesforceRecord folders, uploads and automationIngest Drive documents for AI and analyticsPull Salesforce data into Sheets
Built bySalesforceYou or your partnerSalesforceGoogle Cloud
Code neededNoneApex and LWCNoneNone
My DriveYesYesNoNot applicable
Shared drivesNoYes, with supportsAllDrivesYes (only shared drives)Not applicable
Folder per recordNoYes, if you build itNoNo
Uploads to Drive from Salesforce UINo (API only)YesNoNo

Sources: Salesforce Help on Files Connect and the Files Connect FAQ, Salesforce's Data 360 Google Drive connector limits, and Google's Data connector for Salesforce. Third-party AppExchange apps also exist. Evaluate them like any managed package, against the same questions in this table.

Two Salesforce features often get confused with a Drive integration. Einstein Activity Capture syncs Google email and calendar activity to Salesforce records, and the Gmail integration logs email from Gmail. Neither one connects Drive files.

Section 04 · Setup

How Do You Set Up Salesforce Files Connect for Google Drive?

Create an OAuth client in Google Cloud, enable Files Connect in Salesforce, create an OpenID Connect auth provider, define a Google Drive external data source, and grant users the Files Connect Cloud permission. The admin needs the Customize Application and Manage Auth. Providers permissions, and should set it up in a sandbox first.

Step by step

1. Create the Google Cloud project and OAuth client.
→ In the Google Cloud console, create a project, enable the Google Drive API, configure the OAuth consent screen, and create an OAuth client ID of type Web application. Keep the client ID and secret for step 3. If everyone signs in with your Google Workspace domain, choose the Internal user type; Google exempts internal-only apps from restricted-scope verification.
2. Enable Files Connect and choose the sharing mode.
→ In Salesforce Setup, open Files Connect, click Edit and select Enable Files Connect. Choose Copy or Reference as the org-wide File Sharing mode (explained below).
3. Create the auth provider.
→ In Setup, open Auth. Providers, click New and choose the OpenID Connect provider type. Paste the Google client ID and secret, set the authorize endpoint to https://accounts.google.com/o/oauth2/auth?access_type=offline&approval_prompt=force, the token endpoint to https://accounts.google.com/o/oauth2/token, and the default scopes to openid email profile https://www.googleapis.com/auth/drive.
4. Send the callback URL back to Google.
→ Saving the auth provider generates a Callback URL. Add it to the OAuth client's Authorized redirect URIs in the Google Cloud console.
5. Define the external data source.
→ In Setup, open External Data Sources, click New, and choose the type Files Connect: Google Drive, OAuth 2.0 and the auth provider from step 3. Pick Per User (each person signs in with their own Google account) or Named Principal (one shared Google account for everyone).
6. Give users access.
→ Assign the Files Connect Cloud permission through a permission set. For a Per User source, also add the data source under External Data Source Access in that permission set.
7. Users connect their accounts.
→ With Per User, each person opens My Settings, then Authentication Settings for External Systems, and completes the Google sign-in. They repeat it if the token expires.
8. Add Drive to global search (recommended).
→ Create an external object from the data source with Validate and Sync, grant Read access to it, and in Lightning Experience create a custom tab so Drive results appear in search.

The official steps are in Salesforce Help: set up Files Connect, create the Google Drive auth provider, define the external data source and include Drive in global search.

Copy or Reference: the decision to make first

The sharing mode applies to the whole org, so decide it before users start sharing files.

ModeWhat happensChoose it when
CopyA copy of the Drive file is stored in Salesforce. Chatter group members can open it even without access to the Drive file. It uses Salesforce file storage.You share files with external customers or partners through Salesforce.
ReferenceSalesforce points to the file in Drive and always opens the latest version. There are no previews, and downloads need Drive access.Drive permissions must stay in control, and you want to save Salesforce storage.

In either mode, edits made in Drive do not appear as file revisions in Salesforce. Reference mode simply opens the newest Drive version.

Section 05 · Limits

What Are the Limitations of Files Connect with Google Drive?

The biggest one is that Files Connect does not support Google Drive shared drives. It only works with each user's personal My Drive. If your company keeps client and deal folders in shared drives, which is common in Google Workspace, users will not see them. Check this before you choose Files Connect.

No shared drives. Salesforce's Files Connect FAQ states that only a user's personal My Drive is supported.
No uploads or edits to Drive from the Salesforce UI. The Chatter REST API can create and update Drive documents, but the standard interface is for browsing, opening and sharing.
No folder per record. Files are shared to records or posts one by one. Nothing creates or links an account or opportunity folder.
Revisions do not sync. Drive edits do not create Salesforce file versions, so a copied file can go stale.
Narrow Recent list and search. Recent shows the 24 most recently accessed Drive documents from the last 30 days. Drive search fields are not sortable, custom Drive properties are not supported, and name searches allow only a prefix wildcard.
Broad Google scope. The documented setup requests the full drive scope, which Google classes as restricted. Plan your OAuth consent screen accordingly (see the security section).

Sources: Files Connect FAQ, sharing external files and Files Connect search considerations. For many teams these limits are acceptable. When they are not, a custom build is the next step.

Section 06 · Custom Build

How Do You Build a Custom Google Drive Integration in Salesforce?

Use a Lightning Web Component for the interface, the Google Picker for file selection, Apex callouts to the Google Drive API for folders and uploads, and a named credential for authentication. Store the link between each record and its Drive folder in Salesforce. This gives you record folders, shared drives and automation that Files Connect does not offer.

The architecture has four layers. Each one replaces something in the 2020 approach that no longer holds up.

Layer 1 · Authentication

Named credential and external credential

Salesforce recommends named credentials with external credentials, the model introduced in Winter '23, over legacy named credentials. The external credential holds the OAuth 2.0 configuration, the tokens are stored encrypted, and permission sets control who can use them. Because the callout endpoint is a named credential, no Remote Site Setting is needed, and no client secret ever sits in page or Apex code.

Layer 2 · User interface

Lightning Web Component with Google Picker

The Google Picker is Google's File Open dialog. Users select or upload Drive files without leaving the app, and the Picker returns file IDs and URLs. Google's current web sample gets tokens through Google Identity Services. The old Google Sign-In library used in many Visualforce examples was deprecated on March 31, 2023, and new OAuth clients cannot use it. Restrict the Picker's API key to your domains plus https://docs.google.com/*, because the Picker renders in an iframe there.

Layer 3 · Drive operations

Apex callouts to the Drive API

Apex creates folders, uploads files and sets permissions through the Drive API. To work with shared drives, every call must send supportsAllDrives=true, and file listings also need includeItemsFromAllDrives=true. The Picker cannot move, copy or organize files, so those actions belong here too.

Layer 4 · Record mapping

A mapping object between records and folders

Store each Salesforce record ID with its Drive folder ID in Salesforce. A dedicated mapping object is safer than a field on the opportunity or account, because writing to those records can fire validation rules and automation you do not control. A record-triggered flow or button can then create the folder, named from the record, the first time it is needed.

References: Salesforce Help on named credentials and external credentials, the Apex callouts guide, and Google's web Picker guide, Sign-In deprecation notice and shared drives guide.

What changed from the 2020 Visualforce method

2020 approachCurrent approachWhy
Visualforce pageLightning Web ComponentModern UI on Lightning record pages, with file handling in the browser
gapi.auth sign-inGoogle Identity Services token clientThe old library is deprecated, and new client IDs cannot use it
API key and client ID typed into page codeNamed and external credentials, plus a restricted API keySecrets stay encrypted in Salesforce, not in readable source
Remote Site Setting for googleapis.comNamed credential as the callout endpointSalesforce manages the endpoint and authentication
Full drive scopedrive.file with the Picker, where possibleNon-sensitive scope, no restricted-scope assessment
Section 07 · Large Files

How Do You Upload Large Files from Salesforce to Google Drive?

Use Google's resumable upload and send the file in chunks from asynchronous Apex, such as chained Queueable jobs. A single callout cannot carry a large file, because Apex caps each callout request at 6 MB in synchronous code and 12 MB in asynchronous code. Google itself recommends resumable uploads for anything over 5 MB.

LimitValueWhat it means for Drive uploads
Callout request or response size6 MB synchronous, 12 MB asynchronousLarger files must be split into chunks
Total heap size10 MB synchronous, 25 MB asynchronousCallout payloads count towards heap, so keep chunks small
Callouts per transaction100Spread long uploads across chained jobs
Callout timeout10 seconds by default, 120 seconds maximumSet the timeout explicitly for upload calls
Google resumable sessionSession URI valid for one weekStore it so an interrupted upload can continue

Sources: Salesforce Apex governor limits and callout limits and timeouts, and Google's upload guide.

The flow works like this. The first callout starts a resumable session, and Google returns a session URI. Each Queueable job then sends the next chunk to that URI and enqueues the following job. A 308 Resume Incomplete response tells you which bytes Google has received, so you continue from there. A 404 means the session has expired and the upload starts again. Remember that you cannot make a callout after DML in the same transaction, so save records before or after the callout.

Twopir Consulting built exactly this pattern for a Salesforce client whose large uploads to Google Drive kept failing. We replaced a Visualforce upload page with a Lightning Web Component, split files into roughly 2 MB chunks sent through chained Queueable Apex to Google's resumable upload API, added a custom object to map records to Drive folders, and automated folder creation from record names. The client reported zero upload failures for large files after go-live. The full story is in our Google Drive integration case study.

Section 08 · Security

How Do You Keep a Salesforce Google Drive Integration Secure?

Ask for the narrowest Google scope that works, keep credentials in Salesforce named or external credentials, and remember that Drive sharing and Salesforce sharing are separate systems. A user who can see an opportunity cannot automatically open its Drive files, and removing someone from Salesforce does not remove their Drive access.

Choose the scope deliberately

ScopeGoogle classificationAccessConsequence
drive.fileNon-sensitiveOnly files the app creates or opens, or the user picks in the PickerRecommended by Google; no restricted-scope assessment
drive, drive.readonlyRestrictedAll of the user's Drive filesPublic apps that store or send this data through a server need verification and a CASA security assessment, renewed at least every 12 months

Internal-use apps, created in your organization's Google Cloud project with the Internal user type, are exempt from that verification. That is why most Files Connect setups for a single company use an Internal consent screen. Sources: Google's Drive API scopes and restricted scope verification.

Security checklist

Do. Use Per User authentication so Drive permissions apply to each person. Prefer Reference mode when Drive access must stay authoritative. Assign the Files Connect Cloud permission and named credential access through permission sets. Give folders to groups, not individuals, and use Drive's Viewer, Commenter and Editor roles. Add Google access to your offboarding checklist.

Avoid. Pasting API keys, client IDs or secrets into Visualforce, LWC or Apex source. Leaving the Picker's API key unrestricted. A Named Principal account with wide Drive access that every Salesforce user borrows. Copy mode for confidential files that external users can reach through Chatter. "Anyone with the link" sharing on client folders.

Drive permissions inherit downwards, and a child folder cannot have less access than its parent. Design the folder tree so that confidential folders do not sit under widely shared ones. Google documents this in its sharing guide. For the Salesforce side of the access model, see our guide to profiles and permission sets.

Section 09 · AI and Data

Can Agentforce Use Google Drive Files?

Yes, through the Google Drive Unstructured connector in Data 360 (formerly Data Cloud), which ingests documents from Google shared drives for AI and data use cases. It is a data pipeline, not a file panel. It runs in batches with a Google service account and does not read personal My Drive folders.

  • Setup. The connection is created in Data Cloud Setup by a System Administrator or a user with the Data Cloud Architect permission set. It needs a Google service account, its JSON key, the Drive API and Drive Labels API, and your Google Workspace customer ID. Salesforce's preparation guide notes that the service account can be used for Agentforce use cases.
  • Scope. The connector requests read-only Drive and Drive Labels scopes. Ingesting every shared drive needs domain-wide delegation, while a single shared drive can be targeted by its ID.
  • Limits. Only shared drives, with no folder-level filter. Files are capped at 100 MB for PDF and CSV-type formats, 20 MB for images and 4 MB for other formats. Files not modified for more than two years are skipped, and one job can ingest up to 270 GB.

Details are in Salesforce's connection setup, preparation and limitations pages. A tidy shared-drive structure, which a custom record-folder integration encourages, also makes this ingestion far more useful. Our Agentforce data and knowledge integration service covers that work.

Section 10 · Fit

Should You Use Files Connect or a Custom Google Drive Integration?

Choose Files Connect when users need to find and share their own Drive files from Salesforce. Choose a custom build when documents must be organized per record, live in shared drives, or upload automatically. Many companies start with Files Connect and add a custom layer only for the objects where folder structure matters.

Files Connect is enough. Files sit in users' own My Drive. People mainly attach or reference documents in posts and records. You want a no-code setup that admins can own. You are on Professional edition or above and have no need for uploads from Salesforce into Drive.

Plan a custom build. Client and deal folders live in shared drives. Every account, opportunity or case needs its own folder, created automatically. Users upload large files from Salesforce. You need Drive actions inside Flow, or you want folder structure ready for Data 360 and Agentforce.

Questions to answer before you start

  1. 1

    Are your important folders in My Drive or in shared drives?

  2. 2

    Which objects need files, and should each record get its own folder?

  3. 3

    Should Drive permissions or Salesforce sharing decide who sees a file?

  4. 4

    How large are the files users upload, and from where?

  5. 5

    Who owns the Google Cloud project, the OAuth client and the named credentials after go-live?

Section 11 · Bottom Line

The Bottom Line

A Salesforce Google Drive integration keeps documents in Drive and puts them where sales and service teams work. Files Connect covers the simple case well, as long as your files are in My Drive. Shared drives, record folders and large uploads call for a custom build on named credentials, the Google Picker and resumable uploads. Twopir Consulting designs and builds these integrations, from the scope and folder model through to chunked uploads that stay inside Salesforce limits.

Ready to Start

Connect Salesforce and Google Drive the Right Way

Tell us where your files live and how your teams use them. We will recommend Files Connect or a custom build, and map the scopes, folders and permissions your org needs.

Schedule a Discovery Call

FAQ

Frequently Asked Questions

Yes. Salesforce Files Connect connects Google Drive as an external data source, so users can browse, search, open and share Drive files from Salesforce without code. It is available in Professional, Enterprise, Performance, Unlimited and Developer editions, in Lightning Experience and Salesforce Classic. Users need the Files Connect Cloud permission.

No. Salesforce's Files Connect FAQ states that Google Drive shared drives are not supported and that only a user's personal My Drive works. To reach shared drives from Salesforce, use a custom integration that calls the Drive API with supportsAllDrives set to true. The Data 360 Google Drive connector reads shared drives, but for data ingestion only.

Not when they are referenced. In Files Connect Reference mode, Salesforce points to the file in Drive, so it stays in Google storage. Copy mode stores a copy in Salesforce, which uses file storage. A custom integration that uploads straight to Drive and keeps only the folder or file ID in Salesforce also avoids Salesforce file storage.

Not with the standard Files Connect interface, which is built for browsing and sharing. A custom Lightning Web Component can upload to Drive through Apex callouts. Files over 5 MB should use Google's resumable upload, sent in chunks from asynchronous Apex, because Salesforce caps each callout at 6 MB synchronous and 12 MB asynchronous.

Use drive.file where you can. It is non-sensitive and covers files the app creates or the user selects in the Google Picker. The full drive scope is restricted: public apps that handle that data through a server need Google verification and an annual security assessment. Internal-only apps in your own Google Workspace organization are exempt.

It needs updating. Many older examples use Google's Sign-In JavaScript library, which Google deprecated in March 2023 and which new OAuth clients cannot use, and they often put API keys in page code. Rebuild it as a Lightning Web Component using Google Identity Services, a restricted API key, and Salesforce named credentials for server-side calls.

Through Data 360, yes. Its Google Drive Unstructured connector ingests documents from Google shared drives using a service account, and Salesforce notes that this service account can be used for Agentforce use cases. It does not read My Drive, and it skips files over its size caps or unchanged for more than two years.

TC

Twopir Consulting

Salesforce Partner · HubSpot Partner

Twopir Consulting helps growing and mid-market companies solve complex CRM, integration, and business system challenges. We implement, rescue, optimize, and integrate complex CRM and revenue systems, including Google Drive, Egnyte and other document integrations for Salesforce, for 500+ clients over 12+ years.