Data Export from Salesforce Developer Console

Developer Console is a very useful tool, but at time of this writing you cannot easily do a data export from it. There is a (kind of) easy workaround using “Inspect Element” of Google Chrome. Those steps follow.

Steps to Export Data from Developer Console Query Results

  1. First, run the query that generates the data of interest using Google Chrome. Note that ApexCodeCoverage and ApexCodeCoverageAggregate in particular are only available via the Tooling API, which can be queried from the Developer Console. The following queries may be helpful.
SELECT Id, ApexTestClassId, TestMethodName, ApexClassorTriggerId, 
       NumLinesCovered, NumLinesUncovered, Coverage
  FROM ApexCodeCoverage
SELECT ApexClassorTriggerId, NumLinesCovered, NumLinesUncovered, Coverage 
  FROM ApexCodeCoverageAggregate
SELECT Id, NamespacePrefix, Name, ApiVersion, Status, IsValid, BodyCrc, 
       Body, LengthWithoutComments, CreatedDate, CreatedById, LastModifiedDate, 
       LastModifiedById, SystemModstamp
  FROM ApexClass

  1. Then, right-click on the data, then “Inspect.”

  1. Look through the resulting Inspect Window to find the div with soqlgrid- followed by a few numbers. Right-click it, then “Copy,” then “Copy element.” Paste it into Excel. If that doesn’t work (the result may be HTML), try “Copy element” on the div with gridview- followed by a few numbers.

Note that pasting it into other programs, like a plain text file or Google Sheets, may yield HTML. Try Excel.