Back to Salesforce Service Cloud in Google Sheets
SheetXAI logo
Salesforce Service Cloud logo
Salesforce Service Cloud · Google Sheets Guide

Pull Live Salesforce Case Data Into a Google Sheet With SOQL

2026-05-14
5 min read

The Scenario

It's Sunday evening. The Monday morning triage meeting starts at 9 AM and the customer success director wants every open high-priority case from the last seven days on the screen before anyone says good morning.

You have a Google Sheet set up for exactly this — CaseNumber, Subject, Owner, AccountName, CreatedDate. It just has last week's data in it. Getting fresh data means logging into Salesforce, running a report, exporting it, opening the CSV, cleaning the headers, pasting into the sheet, and fixing whatever the column order disagreement introduced.

The bad version:

  • Log into Salesforce Reports, navigate to the case report, change the date filter, run it, export to CSV.
  • Open the CSV, discover the column headers are in a different order than the sheet, manually reorder them.
  • Paste the data in, find that AccountName is missing for 12 rows because the report used a different field name than you expected.

Your Sunday evening is now your Monday morning prep work, eating into the time you needed to actually read the cases before the meeting starts.

The Easy Way: One Prompt in SheetXAI

SheetXAI is an AI agent that lives inside your Google Sheet. It connects to Salesforce Service Cloud and can run SOQL queries for you, writing the results directly into your sheet.

Run a SOQL query to get all open Salesforce Service Cloud cases with Priority equal to High created in the last 7 days and populate this sheet with CaseNumber, Subject, Owner, AccountName, and CreatedDate

What You Get

  • A SOQL query constructed and executed against your Salesforce org.
  • Results written into the sheet starting at row 2, with columns matching what you asked for.
  • CreatedDate formatted as a readable date string, not a raw ISO timestamp.
  • If the query returns zero rows, the sheet is cleared and a note is written so you know it ran and found nothing rather than guessing whether it ran at all.

What If the Data Is Not Quite Ready

The Owner field returns an ID instead of a name

Salesforce sometimes returns OwnerId instead of resolving to Owner.Name.

Run a SOQL query for all open Salesforce cases with Priority equal to High created in the last 7 days — use Owner.Name not OwnerId — and write CaseNumber, Subject, Owner.Name, Account.Name, and CreatedDate into this sheet

You need cases from multiple priorities, not just High

The meeting now includes Medium cases that have been open for more than 48 hours.

Query Salesforce for all open cases where Priority is High or where Priority is Medium and CreatedDate is more than 2 days ago — write CaseNumber, Subject, Priority, Owner.Name, AccountName, and CreatedDate into this sheet

Results need to be sorted by account before they hit the sheet

The director wants to scan by account, not by created date.

Run a SOQL query for open High-priority Salesforce cases from the last 7 days, sort by AccountName ascending, and write CaseNumber, Subject, Owner.Name, AccountName, and CreatedDate into this sheet starting at row 2

Clear the old data, pull fresh results, and flag anything without an owner

You want stale rows gone, fresh results in, and any unassigned case highlighted.

Clear all data below row 1 in this sheet, then run a SOQL query for all open High-priority Salesforce cases created in the last 7 days — write CaseNumber, Subject, Owner.Name (or Unassigned if blank), AccountName, and CreatedDate, and mark column F as REVIEW for any row where Owner.Name is empty

One prompt builds the triage sheet from scratch, flags the gaps, and leaves it ready before the meeting starts.

Try It

Get the 7-day free trial of SheetXAI and open whatever sheet you normally populate before your triage meetings, then ask SheetXAI to fill it with live Salesforce data. For related reading, see the hub overview or the spoke on enriching existing Case IDs with current details.

Stop memorizing formulas.
Tell your spreadsheet what to do.

Join 4,000+ professionals saving hours every week with SheetXAI.

Learn more