- How to export salesforce contacts, accounts, opportunities, leads, users, cases
- How to export directly from Salesforce to Excel, Google Sheets and Airtable
- How to keep the data sync’d daily
- Advantages of having your salesforce data exported to another system like Excel
- Examples of how you can use your
- SyncWith Salesforce data connector for Google Sheets to pull exactly the data we need and put it anywhere we want it
- Google Sheets as a example place to export salesforce data and leverage it
- SOQL as a means to specify exactly which data we want to export from Salesforce
Don’t worry SOQL isn’t too scary but if you want to export data on a schedule to Excel, Google Sheets or Airtable without needing to write SOQL take a look at our instructions on how to sync salesforce reports to Sheets and Excel. Then you can design your report in Salesforce and sync it daily or even hourly to your platform of choice.
To do this check out our tutorial on exporting salesforce reports
Assume that it’s really easy to send SOQL to Sealeforce and have it send results back. The first thing we need to know a little bit about is SOQL, then we’ll be in a better position to backup saleforce data or export the data we want.
Here’s a quick video showing the whole process front to back before we dive in - it’s easier than you’d think.
SOQL (Salesforce Object Query Language) is a way to express the data you want from salesforce. Its a fairly simple and robust way to get the data you want
Lets say you want the
Select Name, Phone, Email from Contact
That’s it - send this query to Saleforce and you get sent back all your contacts
Often you just want objects returned that are recent, to do that you use the
LAST_N_DAYS:Ndate literal, eg if we want contacts created in the last 90 days we use:
Select Name from Contact where CreatedDate = LAST_N_DAYS:90
Other popular date literals when exporting salesforce data are:
Normally you would type
Selectand then your list of field names. But if you want to get all the fields you can use the
Fields()function which can get you all the fields, all the standard fields or all the custom fields using
CUSTOM. The only caveat is that you can only pull a maximum of 200 records when using the fields function. Pulling this together:
- All the fields for your opportunity object
- Get the maximum number (200) when using the fields function
Select Fields(ALL) from Contact limit 200
We’ll be using SyncWith to export data from Salesforce. SyncWith can directly and on a schedule export or backup Salesforce data to Google Sheets, Excel and Airtable.
It’s as easy as 1 2 3
- SyncWith is an addon for Google Sheets, Excel and Airtable
- SyncWith allows you to move data from any API including marketing and sales platforms like Hubspot, Salesforce, Google Ads and Facebook
- ⭐️⭐️⭐️⭐️⭐️ Reviewed by hundreds of businesses
- Highest rated API add on with over 100,000 installs. Install today.
- Export Salesforce
Google Sheets- install our Google Sheets addon used by 100,000s of other data users
We’ll run through 5 examples
- Export salesforce contacts
- Export salesforce accounts
- Export salesforce oppotunities
- Export salesforce leads
SELECT Name, Title, Email, Account.Name, Phone, MobilePHone, Department, LeadSource, Description, Birthdate FROM Contact
Contacts just from
United OIl & Gas Corp.
//How to export salesforce contacts from a specific account SELECT Name, Title, Email, Account.Name, Phone, MobilePHone, Department, LeadSource, Description, Birthdate FROM Contact WHERE Account.Name = 'United Oil & Gas Corp.'
SELECT Name, Title, Company, Status, Rating, AnnualRevenue, Email, IsConverted FROM lead
Maybe we only want leads that are open and not contacted so we can see if reps are staying on top of the new leads
SELECT Name, Title, Company, Status, Rating, AnnualRevenue, Email, IsConverted FROM lead WHERE status = 'Open - Not Contacted'
But maybe we want to understand which leads are still non Contacted too long after they were created, eg the lead is over a week old and we still haven’t contacted in 14days since being created. We’ll also add the field CreatedDate and Owner.Name so we can see how stale the leads are and who the owner is, we’ll remove Ratting and AnnualRevenue since at this stage they’ll be blank
SELECT CreatedDate, Name, Title, Company, Status, Email, IsConverted, Owner.Name FROM lead WHERE status = 'Open - Not Contacted' and CreatedDate < LAST_N_DAYS:14
We could even add a helper column in the spreadsheet to show how old they are:
SELECT Name, Account.Name, StageName, Amount, ExpectedRevenue,CloseDate FROM Opportunity
Say we just want to export new opportunities, eg a screen that always shows the opportunities from the last month ordered by newest first:
SELECT CreatedDate,Name,Account.Name, StageName, Amount, ExpectedRevenue,CloseDate FROM Opportunity WHERE CreatedDate = LAST_N_DAYS:14 ORDER BY CreatedDate desc
Or perhaps we only want to export salesforce opportunities that are in
Closed Won, in that case we us the
inoperator in SOQL and a comma separated list of values that are valid
SELECT CreatedDate,Name,Account.Name, StageName, Amount, ExpectedRevenue,CloseDate FROM Opportunity WHERE StageName In ('Qualification','Closed Won')
SELECT Name, Owner.Name, Industry, AnnualRevenue, Site, Rating, LastActivityDate FROM Account
Lets say you only want to look at Accounts that are warm
SELECT Name, Owner.Name, Industry, AnnualRevenue, Site, Rating, LastActivityDate FROM Account WHERE Rating = 'Warm'
If you’re running salesforce and you want to have a daily backup of your salesforce data, you can setup a daily sync from Salesforce to Google Sheets. You do this by simply turning on a refresh schedule.
- Having the data in a spreadsheet makes it more portable if you want to switch to another CRM provider
- Having data in a online tool like Sheets or Excel means you can collaborate and share reports with folks without needing to give them salesforce licenses
- Marry the data with other information coming in such as marketing, lead or financial information you can’t easily bring into salesforce
- Calculate Salesperson commissions more easily using formulas and pivots
- Monitor new leads coming in (you can even setup hourly syncs)
- Better bulk editing of accounts and other objects before uploading back to salesforce