+ Start a Discussion
Yogesh BiyaniYogesh Biyani 

How to download the developer console query results?

Following query results in 17000+ records. How do I save this result to csv/excel file? I tried SDFC Dev Console Data Exporter  but is saves only about 1000 rows. 
    CreatedDate,Id, Owner.Name,Inquiry_Type__c,
(SELECT id FROM EmailMessages 
WHERE Incoming = true)
FROM Case WHERE Sales_Department__c='Sales' AND Response_Indicator__c=TRUE
Raj VakatiRaj Vakati
I dnt think so you can able to do it .. try to use workbench and export from there 
open workbench: https://workbench.developerforce.com
Select (Production/Sandbox) depending on from where you've to export csv file and login.
(If you are using free Developer org, select 'Production')
From Menu, select Query -> soql Query
Follow the image, click on 'Query' button. In the next screen, you'll be able to download the file.

Please mark this as BEST ANSWER, id this helps solve your problem.
Yogesh BiyaniYogesh Biyani
Hello Mritzi,

I tried workbench but get "InvalidJob: Unable to find object: EmailMessages". If I recall correctly workbench does not support nested queries. 

User-added image

I was able to use G-Connector for Salesforce and get the results in Google Sheets.

  1. Open Developer console in "google Chrome" browser"
  2. Run query on any object for which you want to export the data
  3. Once the data is displayed then  right click on first row and then select "Inspect" 
  4. In the "Elements" tab, search for <div id>="gridview" .
  5. Right click on that row which show <div id>= "gridview" , then click on "Copy" -> Copy element
  6. Open MS excel or Google sheet and paste .  

 User-added image
David Roberts 4David Roberts 4
An alternative approach is to use the Execute Anonymous Window.
This is especially useful if a straightforward query doesn't refine your data enough.
Here's trivial example finding contacts from a phone area then filtering account names less than 11 characters long.

Note the extra comma before the first field to separate the debug info from the other fields. Also, Excel treats some numeric text as numbers and can corrupt them. Prefix with a letter to avoid this.
Contact[] queriedObjects = [Select ID, Name, Account.Name, MobilePhone, Phone
FROM Contact WHERE Phone LIKE '0161%'  ORDER BY lastname];
Integer Count =0;
String strTest;
for (Contact e : queriedObjects) {
    strTest = e.Name;
    if (strTest.length() <= 10){
        Count += 1;
        system.debug(','+e.Name + ', T'+ e.Phone + ', '+e.Account.Name);

Execute the code;
Download the debug log to text;
In notepad, remove unwanted debug lines before and after the actual desired field values;
Save as csv and open in Excel;
Remove the first column (the debug statements).