Salesforce Connector for Google Sheets

On This Page

Introduction

Salesforce holds the record of truth for leads, contacts and opportunities, and the review usually happens in a spreadsheet. The Salesforce connector pulls a standard or custom object into Flookup Staging, so you can deduplicate, standardise or match the records with the same tools you use on any sheet.

Included with the 1-Year Pass and the Team Pass. The 1-Month Pass and the free trial do not include connectors. See pricing for details.

Open Extensions > Flookup Data Wrangler > Data Connectors and choose Salesforce. Unlike Airtable, Salesforce uses OAuth, so there is a Connected App to create once in your org.


Before You Start

Salesforce setup is mostly about permissions, and the person who grants them is often not the person who runs the pull.

Ask for a dedicated integration user if your org separates admin from daily work. A leaver's account takes its Connected App authorisation with it, which turns a working sheet into a broken one overnight.


Create the Connected App

The Connected App is created once for the whole org. Allow about ten minutes for the first setup, then reuse the same key and secret for every pull.

  1. In Salesforce, open Setup, then App Manager, and click New Connected App.
  2. Give it a name such as Flookup Sheets and a contact email, then tick Enable OAuth Settings.
  3. Paste the callback URL shown in the Salesforce card. It is https://script.google.com/macros/d/<SCRIPT ID>/usercallback and the sidebar fills in the real id.
  4. Add the scopes Manage user data via APIs (api) and Perform requests at any time (refresh_token, offline_access).
  5. Save, then wait a few minutes. A new Connected App can take up to ten minutes to become active.
  6. Click Manage Consumer Details and copy the Consumer Key and Consumer Secret.

The callback URL contains the script id of the Apps Script project that runs Flookup. If you install the add-on from the Marketplace, the id is the published one. If you copy the code into your own project, the id changes and the Connected App must be updated.


Connect Salesforce

  1. Paste the Consumer Key and Consumer Secret into the Salesforce card.
  2. Choose Production or Sandbox. A sandbox authorises against test.salesforce.com.
  3. Click Save app.
  4. Click Connect and authorise Flookup in the tab that opens.
  5. Return to the sidebar and click Refresh status.

The tokens are stored in your Apps Script user properties and the consumer secret is never shown back in the sidebar. The access token is refreshed automatically after roughly 100 minutes and once more if Salesforce rejects it. Use Disconnect to remove the stored tokens; the Connected App stays in Salesforce until you delete it there.


Choose Objects and Fields

Click Load objects to list the objects your user can query, then choose one. Only queryable objects appear, so a setup object that cannot be read with SOQL is left out.

The field list comes from the object describe. Address, location and deprecated fields are hidden because SOQL cannot select them directly. Tick the fields you need. Include Id when the sheet will be compared with another export.


Build the SOQL Query

The sidebar assembles SELECT … FROM … WHERE … ORDER BY … LIMIT … from your choices and shows the statement before it runs. You can edit the query directly.


Pull Records

Click Pull to staging. Flookup clears the staging sheet, writes the field names as a bold header row and then the records.

Salesforce write-back is not part of this version. Clean the staging sheet, then edit the records in Salesforce or export the result.


Plan a Large Pull

An object bigger than 5,000 records has to arrive in slices. Pick the split that matches how the records change, then copy each slice into your own tab before pulling the next one, because a pull replaces the staging sheet.

Keep the filter in the saved query, not in your notes. The next person to run the pull needs to see which slice the sheet represents.

One warning about date slices: a record edited during the export can move between windows, so it may appear twice or not at all. For a one-off review that is harmless. For a reconciliation, sort the combined sheet by Id and check for duplicate ids before you trust the total.


Troubleshooting

Symptom Cause and fix
redirect_uri_mismatch The callback URL in the Connected App does not match this script. Copy the URL from the sidebar into the Connected App again.
invalid_client_id The key belongs to the other environment. A sandbox key will not work against production, and the reverse is also true.
API is not enabled for this org The edition has no API access. A Developer Edition org works for testing; a paid edition is needed for daily use.
INVALID_SESSION_ID after a while The refresh token was revoked, often by a password change or an admin policy. Click Connect again.
No fields appear for an object The user profile cannot read the object or its fields. Grant field-level access in Salesforce and load the object again.
The pull stops at 5,000 That is the connector cap. Add a WHERE clause on a date or a status and pull the object in several passes.

Frequently Asked Questions

Is the Salesforce connector read only?

Yes. It pulls records into Google Sheets but never writes back. Write-back is available for Airtable and SQL databases.

How many Salesforce records can one pull return?

A pull stops at 5,000 records and reports that it was truncated. Add a WHERE clause to split a larger object into several pulls.

Does the Salesforce connector use the Bulk API?

No. It pages through the REST query API using nextRecordsUrl. For millions of records, run a Bulk API job or Data Loader export and work with the CSV instead.

Can the connector use a Salesforce sandbox?

Yes. Choose Sandbox in the Salesforce card before connecting, and create a separate Connected App in the sandbox org with the same callback URL.

Does the connector store the Salesforce password?

No. It uses OAuth, so you authorise Flookup in a Salesforce tab and the password never reaches the add-on. The consumer key and secret are stored in your Apps Script user properties.


You Might Also Like