Private Google Sheet
Connect private Google Sheets to Memex using service account authentication.
When to Use This Connector
Use the Private Google Sheet connector when you have a Google Sheet that:
Contains sensitive or confidential data
Is shared only with specific people
Requires authentication to access
If your sheet is publicly accessible (shared with "Anyone with the link"), use the simpler Public Google Sheet connector instead.
Requires a Google Cloud project
Due to Google's API limitations, accessing private sheets requires a Google Cloud Platform service account. This involves creating a GCP project (which requires a Google account) and sharing your sheet with the service account. If you don't want to set this up, consider making your sheet public and using the Public Google Sheet connector instead.
What You'll Need
To connect a private Google Sheet, you'll need:
Spreadsheet URL
The full URL of your Google Sheet
Service Account JSON
A JSON key file from Google Cloud Platform
Setting Up Access
This connector requires a Google Cloud service account that has been granted access to your spreadsheet. Here's how to set it up:
Step 1: Create a Google Cloud Project
Go to the Google Cloud Console
Click Select a project → New Project
Enter a Project name (e.g., "Memex Sheets Access")
Click Create
Step 2: Enable the Google Sheets API
Go to APIs & Services → Library
Search for "Google Sheets API"
Click on it and press Enable
Step 3: Create a Service Account
Go to IAM & Admin → Service Accounts
Click Create Service Account
Enter a Name (e.g., "Memex Sheets Reader")
Click Create and Continue
For the role, select Viewer (basic read access)
Click Continue, then Done
Step 4: Create and Download the JSON Key
Click on the service account you just created
Go to the Keys tab
Click Add Key → Create new key
Select JSON format
Click Create
The JSON key file will download automatically. Note the client_email field—you'll need it in the next step.
Step 5: Share Your Google Sheet with the Service Account
This is a crucial step—your service account needs permission to access the sheet:
Open your Google Sheet in a browser
Click the Share button (top-right corner)
Paste the service account email (the
client_emailfrom your JSON key)Set the permission to Viewer (or Editor if you need write access)
Uncheck "Notify people" (service accounts can't receive emails)
Click Share
Don't skip this step! Without sharing the sheet with the service account email, the connection will fail with a "permission denied" error.
Connecting to Memex
Open the Memex Hub from the sidebar
Click on the Connectors tab
Click on the Private Google Sheet card
Enter a Connection Name (e.g., "Sales Data Sheet")
Paste your Spreadsheet URL (the full URL from your browser)
Open your downloaded JSON key file in a text editor
Copy the entire contents and paste into the Service Account JSON field
Click Add Connection
Your private Google Sheet is now connected! Memex can access it across all your conversations.
Verifying Your Connection
After connecting, try asking Memex:
If Memex returns your data, the connection is working correctly.
Using Your Connection
Once connected, you can ask Memex to work with your spreadsheet data:
Working with Multiple Sheets
If your spreadsheet has multiple tabs (worksheets), you can specify which one to query:
By default, Memex will read from the first sheet if you don't specify a tab name.
Security Considerations
Service Account Access
The service account only has access to sheets explicitly shared with it. It cannot:
Access other sheets in your Google account
See your Google Drive contents
Access any data you haven't shared with it
Sharing Best Practices
Share sheets with Viewer permission unless Memex needs to write data
Only share specific sheets, not entire folders
Review shared access periodically in your sheet's sharing settings
Key Security
Once connected, you can delete the JSON key file from your downloads—Memex stores the credentials securely
Never commit service account keys to version control
If compromised, delete the key in Google Cloud Console and create a new one
Troubleshooting
You can ask the Memex agent to help troubleshoot, but here are a few common problems:
"Permission denied" or "Spreadsheet not found" Error
This almost always means the sheet hasn't been shared with the service account:
Open your Google Sheet
Click Share
Verify the service account email is listed with at least Viewer access
If not, add it and try connecting again
"Invalid JSON" Error
Make sure you copied the entire contents of the JSON file
Check that you didn't accidentally include extra characters
Verify the JSON is properly formatted
"Google Sheets API has not been enabled" Error
Go to the Google Cloud Console
Select your project
Go to APIs & Services → Library
Search for "Google Sheets API" and enable it
Wait a few minutes and try again
Can't Find the Service Account Email
Open your JSON key file and look for the client_email field:
Copy this email address and use it to share your sheet.
Learn More
Last updated
Was this helpful?