CRMSales

Get Salesforce Leads

Alex Black

Colin Dellow

Tutorial Overview

One of the challenges with the default Salesforce connector add-on in Google Sheets is the inability to persist a connection and have it sync on a schedule. In this tutorial we'll create a connection to pull leads in to Google Sheets and have it sync on a schedule.
You can preview live Salesforce leads data right here after you authorize SyncWith to connect to your Salesforce account.
We use the Salesforce Object Query Language (SOQL) to get the last 90 days of lead data, including the default Salesforce lead fields (name, title, email, company website, rating, status, phone, lead source, annual revenue, created by user id and description).

Salesforce SOQL Query to get Leads

The query being passed you'll see in the q field it's as follows:
SELECT 
name, title, email, company, website, rating, status,
phone, leadsource, annualrevenue, createdbyid, description 
FROM lead 
WHERE createddate = LAST_N_DAYS:90

Things to try:

  • Add your custom lead fields - you can find these in the object manger in SFDC: https://yourhost.lightning.force.com/lightning/setup/ObjectManager/Lead/FieldsAndRelationships/view
  • Try changing the default time frame by changing LAST_N_DAYS:90 to 30 or 60
  • Hit the Google Sheet and get leads flowing in on a schedule to Google Sheets

Leads 90d

Please fill in any necessary fields and click Run.

GET

Preview

View the API data, get a live Google Sheet dashboard

nextRecordsUrl
records.attributes.type
records.Name
records.Title
records.Email
records.Company
records.Website
records.Rating
records.Status
records.Phone
records.LeadSource
records.AnnualRevenue
records.CreatedById
records.Description
              
              
              

Get a live Google Sheet

Export your data to a google sheet, with the SyncWith Addon, or download to CSV

Automatically updated

Add data sources

Build reports & dashboards