I am trying to solve a problem of many unused field in my org.

This will be addressed by running a periodic job that will figure out the field usage via number of references and letting the audience decide the field usability.

I tried to use Tooling API and wrote a query based on MetadataComponentDependency object.

The issue I see is that the returned list of references does not contain Reports/ReportTypes which makes it a big issue if we use the results to determine if a field is needed or not.

The behaviour I saw was:

When running the Tooling query, the references in the report type does not show up.

enter image description here

However, when clicking the 'Where is this used' button on the custom field detail page, the returned list DOES contain the custom field as being referenced:

enter image description here

The main issue I'm trying to address here is to periodically send a list of fields and their references to developers/admins based on their usage/reference so that they determine if the field is needed or not.

I intend to achieve this via a job that will call the Tooling endpoint, get the results and mail an audience.

But the above mentioned limitation will not provide the full details of the field usage.

Is there a better way to achieve this?

Any help on this is appreciated!

1 Answer 1


I'm sorry you didn't get an answer, did you manage to figure this out? I'm currently looking at options for determining programmatically when fields are being used by reports. So far the best option seems to be using the REST API to query the report thru the analytics endpoint, eg

GET /services/data/v58.0/analytics/reports/00OPb000001CMvKMAW

This will return a JSON object you can parse for both references to columns and filters on a given report.

  • hi smohyee, no, unfortunately. This story remains in the backlog still :) Commented Apr 26 at 16:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .