Skip to main content
New tool CRON Expression Builder — preview next run times before you schedule Apex. Open the builder →
Screenshot showing the Salesforce REST Explorer used to retrieve detailed report metadata information.
Integration

Retrieve Salesforce report metadata with REST Explorer

Tired of report column names not matching your field API names? Here is how I use the REST API to see the actual Salesforce report metadata in seconds without building a package.xml.

The short answer

You can inspect the underlying structure and exact field API names of a Salesforce report by making a GET request to the Analytics REST API using tools like Workbench or Salesforce Inspector Reloaded. This approach avoids guesswork from renamed UI labels and eliminates the need to build a package.xml manifest or export data to Excel.

Key takeaways Execute a GET request to /services/data/v62.0/analytics/reports/YOUR_REPORT_ID in Workbench REST Explorer to inspect a report without deploying code or metadata manifests. Examine the detailColumns list within reportMetadata to identify the exact field API names and source objects queried by the report. Review the aggregates section under T|T within the factMap to verify how summary reports calculate row totals and summary data. Inspect the reportType property in the response to confirm the underlying report type when custom report types alter or hide field labels.

Salesforce report metadata is reshaping how Salesforce professionals work — and this article breaks down everything you need to know.

Look, we've all been there. You're staring at a report and the column names don't match any field names you know. Instead of guessing or digging through Setup, I just pull the Salesforce report metadata using the apex-callout-solutions/" class="auto-link">REST API. It's a lot faster than building a package.xml and waiting for a metadata retrieve just to see what's under the hood.

Why you should check Salesforce report metadata via REST

I've seen teams spend hours trying to figure out why a report isn't showing the right data. Sometimes it's because the report is using a field from a related object that has the same name as a field on the primary object. It's confusing, right? When you look at the raw Salesforce report metadata, there's no more guessing. You see the exact API name and the object it's coming from.

This is especially handy when you're dealing with standard vs custom report types. Custom report types can hide or rename fields, which makes the UI a bit of a liar. The REST API tells you the truth about what the report is actually querying.

One thing that trips people up is thinking they need to be a hardcore developer to use this. You don't. If you can copy and paste a URL into Workbench, you can do this in thirty seconds.

A professional UI mockup of a REST API explorer tool displaying structured JSON metadata in a syntax-highlighted code view.

A professional UI mockup of a REST API explorer tool displaying structured JSON metadata in a syntax-highlighted code view.

Step-by-step: Pulling Salesforce report metadata

You have a few options here. I usually use Workbench because it's reliable, but if you're into Salesforce Chrome extensions like Salesforce Inspector Reloaded, that works just as well. Here's how I do it.

  1. First, grab the Report ID from your browser's URL. It's that 15 or 18-character string starting with 00O.
  2. Open up Workbench and head over to the REST Explorer.
  3. You'll want to use the GET method.
  4. Enter this URL, swapping out the placeholder for your actual ID: /services/data/v62.0/analytics/reports/YOUR_REPORT_ID
  5. Hit "Execute" and wait for the JSON to pop up.

The raw request example

If you're more of a command-line person, you can do the same thing with a curl command. It looks like this:

GET /services/data/v62.0/analytics/reports/00OGB00000Dt9Qv2AJ

Now, once you get that response back, don't let the big wall of text scare you. You only need to look at a couple of specific spots to find the Salesforce report metadata you're after.

How to read the JSON response

So what does this actually mean? When the results load, you'll see a few folders or keys in the JSON. Here's where it gets interesting. I always expand reportMetadata first. That's where the detailColumns live. This list shows you every column in the report by its API name. No more "Account Name" vs "Company Name" confusion - you'll see "Account.Name" plain as day.

But what if you need to see the actual data structure? Look at the factMap. This section breaks down the totals and the individual rows. If you're troubleshooting a summary report, the aggregates section under T|T will show you exactly how Salesforce is calculating those totals.

Honestly, most teams get this wrong by trying to export the report to Excel to "reverse engineer" it. That's a waste of time. Accessing the Salesforce report metadata directly gives you the blueprint of the report without all the noise.

Key Takeaways

  • The REST Explorer is the fastest way to see API names for report columns.
  • You don't need to deploy any code or XML files to see the report structure.
  • The factMap section is your best friend for verifying aggregated data.
  • Checking the reportType in the metadata helps you confirm you're using the right source.

Next time a stakeholder asks why a report isn't matching their dashboard, don't just click around the Report Builder. Run a quick GET request. It's a professional move that saves you a ton of headache and makes you look like a wizard. It's a simple habit, but it's one of those things that separates the experts from the click-and-hope crowd.

Frequently asked questions

How do you get Salesforce report metadata using REST API?

Copy the 15- or 18-character Report ID starting with 00O, open REST Explorer in Workbench or Salesforce Inspector Reloaded, and execute a GET request to /services/data/v62.0/analytics/reports/YOUR_REPORT_ID.

How do you find the API names of fields used in a Salesforce report?

Send a GET request to the report's Analytics REST API endpoint and expand the reportMetadata section in the JSON response. The detailColumns property lists every column by its exact API name and originating object.

What is the factMap section in Salesforce report metadata?

The factMap section contains the data structure, broken down into totals and individual rows. For summary reports, the aggregates section under T|T reveals the exact calculations Salesforce uses to compute totals.

Newsletter

One email every Tuesday

New guides, tool updates, and the release-note changes that break things.

No spam. Unsubscribe in one click.

Comments

Loading comments...

Leave a Comment