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.fileis non-sensitive, while fulldriveaccess 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.
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.
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 edition | File storage per org | Added per user licence |
|---|---|---|
| Enterprise, Performance, Unlimited | 10 GB | 2 GB |
| Contact Manager, Group, Professional | 10 GB | 612 MB |
| Essentials and Starter | 1 GB | Not 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.
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.
| Question | Files Connect | Custom build | Data 360 Drive connector | Sheets Data connector |
|---|---|---|---|---|
| Main job | Browse, search and share Drive files in Salesforce | Record folders, uploads and automation | Ingest Drive documents for AI and analytics | Pull Salesforce data into Sheets |
| Built by | Salesforce | You or your partner | Salesforce | Google Cloud |
| Code needed | None | Apex and LWC | None | None |
| My Drive | Yes | Yes | No | Not applicable |
| Shared drives | No | Yes, with supportsAllDrives | Yes (only shared drives) | Not applicable |
| Folder per record | No | Yes, if you build it | No | No |
| Uploads to Drive from Salesforce UI | No (API only) | Yes | No | No |
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.
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
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.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.
| Mode | What happens | Choose it when |
|---|---|---|
| Copy | A 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. |
| Reference | Salesforce 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.
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.
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.
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.
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.
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.
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.
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 approach | Current approach | Why |
|---|---|---|
| Visualforce page | Lightning Web Component | Modern UI on Lightning record pages, with file handling in the browser |
gapi.auth sign-in | Google Identity Services token client | The old library is deprecated, and new client IDs cannot use it |
| API key and client ID typed into page code | Named and external credentials, plus a restricted API key | Secrets stay encrypted in Salesforce, not in readable source |
| Remote Site Setting for googleapis.com | Named credential as the callout endpoint | Salesforce manages the endpoint and authentication |
Full drive scope | drive.file with the Picker, where possible | Non-sensitive scope, no restricted-scope assessment |
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.
| Limit | Value | What it means for Drive uploads |
|---|---|---|
| Callout request or response size | 6 MB synchronous, 12 MB asynchronous | Larger files must be split into chunks |
| Total heap size | 10 MB synchronous, 25 MB asynchronous | Callout payloads count towards heap, so keep chunks small |
| Callouts per transaction | 100 | Spread long uploads across chained jobs |
| Callout timeout | 10 seconds by default, 120 seconds maximum | Set the timeout explicitly for upload calls |
| Google resumable session | Session URI valid for one week | Store 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.
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
| Scope | Google classification | Access | Consequence |
|---|---|---|---|
drive.file | Non-sensitive | Only files the app creates or opens, or the user picks in the Picker | Recommended by Google; no restricted-scope assessment |
drive, drive.readonly | Restricted | All of the user's Drive files | Public 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.
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.
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
Are your important folders in My Drive or in shared drives?
- 2
Which objects need files, and should each record get its own folder?
- 3
Should Drive permissions or Salesforce sharing decide who sees a file?
- 4
How large are the files users upload, and from where?
- 5
Who owns the Google Cloud project, the OAuth client and the named credentials after go-live?
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.
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 CallFrequently 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.
Twopir Consulting
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.