Salesforce SOQL: Write Queries & Import Data with GPT in Sheets

Last Modified: August 21, 2023 - 3 min read

Julian Alvarado
Write SOQL Queries & Import Data with GPT in Sheets

Data analysis is a cornerstone of business strategy, but writing custom SOQL queries to import specific Salesforce data can be complex and time-consuming, especially for non-coders. Add the need to combine data from multiple systems, and you’ve got quite the messy, inefficient process.

In this blog, we’ll show how Coefficient’s Formula Builder, powered by GPT, simplifies the creation of custom SOQL (Salesforce Object Query Language) functions and how Coefficient enables data imports from Salesforce directly in Google Sheets–all without ever leaving your sheet.

Step-by-Step Guide: Create A Custom SOQL Query & Import Salesforce Data without Leaving Your Sheet

Start by launching the Coefficient add-on in your Google Sheets.

If you haven’t installed Coefficient yet, head over to the Google Workspace Marketplace to get it.

Click Extensions in the top ribbon of your spreadsheet and select ‘Add-ons’ -> ‘Get add-ons.’

first install the coefficient extension

Type “Coefficient” in the Google Workspace Marketplace menu and select the Coefficient app.

get the coefficient extension in the google workspace marketplace

Click ‘Allow’ to grant Coefficient access to your Google account.  

grant coefficient permission to access your google account

Wait a few moments for the install to complete, then return to your spreadsheet menu.

Click on Extensions -> Coefficient -> Launch.

launch coefficient from the extensions menu

Now you can import your live Salesforce data.

In the Coefficient sidebar, select ‘Import from…’ and choose ‘Salesforce’.

select sales force as a data source

Instead of manually importing Salesforce data, we’ll use the Coefficient GPT Copilot’s Formula Builder to generate a custom SOQL query.

To do this, go back to the Coefficient sidebar and select ‘GPT Copilot.’

select gpt copilot from the coefficient menu

Click ‘Formula Builder.’

select the gpt copilot formula builder

In the Formula Builder, type in the custom query: “Write SOQL to grab all closed won opps over $1000 associated with an Account with name that starts with A. Also include Account industry and billing country fields.“

Click ‘Build.’

describe the formula you wish to build

The Formula Builder will generate a custom SOQL query based on your description. Copy this query.

Coefficient Excel Google Sheets Connectors
425,000 Pros Sync Live Data from Their Business Systems into Spreadsheet

Stop exporting data manually. Sync data from your business systems into Google Sheets or Excel with Coefficient and set it on a refresh schedule.

copy the formula output

Return to Coefficient’s main menu, and select ‘Import from…’

select import from in the coefficient menu

Choose Salesforce as your data source.

select sales force as your data source

Click ‘Custom SOQL Query.’

select custom soql query

Paste the query you copied into the field provided. Give your import a name and click ‘Import.’

paste your query into the text box

In a few moments, your data will populate your spreadsheet.

click enter and wait for your data to populate your spreadsheet

Note: You can set up an auto-refresh for your data to keep it up-to-date. For example, you might choose to refresh your data daily at 9:00 am.

set up auto-refresh for you data

And that’s it! You’ve successfully used the Coefficient GPT Copilot’s Formula Builder to generate a custom SOQL query and import data from Salesforce.

Check out the video tutorial below for a visual guide!

Salesforce SOQL Queries Made Easy with Coefficient

Coefficient’s Formula Builder streamlines SOQL query creation, giving anyone the ability to import data from Salesforce to Google Sheets without a single line of code.

You’ll never write a SOQL query or manually import data again. Formula Builder works for any SOQL query, including:

  • SOQL group by
  • SOQL like
  • SOQL order by
  • SOQL join
  • SOQL contains
  • And more

Get started with Coefficient for free today to start streamlining your data analyses.

Exported with Wordable

Sync Live Data into Your Spreadsheet

Connect Google Sheets or Excel to your business systems, import your data, and set it on a refresh schedule.

Try the Spreadsheet Automation Tool Over 500,000 Professionals are Raving About

Tired of spending endless hours manually pushing and pulling data into Google Sheets? Say goodbye to repetitive tasks and hello to efficiency with Coefficient, the leading spreadsheet automation tool trusted by over 350,000 professionals worldwide.

Sync data from your CRM, database, ads platforms, and more into Google Sheets in just a few clicks. Set it on a refresh schedule. And, use AI to write formulas and SQL, or build charts and pivots.

Julian Alvarado Content Marketing
Julian is a dynamic B2B marketer with 8+ years of experience creating full-funnel marketing journeys, leveraging an analytical background in biological sciences to examine customer needs.
500,000+ happy users
Wait, there's more!
Connect any system to Google Sheets in just seconds.
Get Started Free

Trusted By Over 50,000 Companies