I have noticed that on each object, I have like 20-40 custom fields.

Some have clear names, while others are so esoteric that I have no clue why they were created, and or what are they used for.

Is there a way to run a script/SQL or another method, and get the fields which are mostly empty?

If I have 50,000 contacts and a custom field with a value for only a handful of them, I can figure out which fields to clean/remove.

Is there a way to get that list?

3 Answers 3


If it's feasible, you can use the "Field Trip" app, it's a very popular free app on the App Exchange.


Depending on your coding skills you can either go with:

a Batch that checks all fields for null using Dynamic Apex, something like


which you can call via

Database.executeBatch(new FieldUsageAnalyzer(Contact.sObjectType));

or via Configuration by creating Formula fields for every field you want to check for null.


Based on that you create a summary report that sums up the formulas.


Extract the whole project to Force.com IDE, run a search through Apex, formulas, reports (ugh) etc? :/

And for every external system contacted (Outbound Messages, SOAP call, Informatica or other ETL tool) - contact admins?

If you like to live your life dangerously - disable the fields through field level security and wait out a bit. If nothing breaks (integrations, users complaining about blank reports & page layouts) - off with their heads?

If you'll want to gather some field statistics you can always run some simple SOQL / reports / analytic snapshots but I'm not aware of any tool that'd say "looks like these fields are unused".

  • naa, too cumbersome
    – Saariko
    May 27, 2013 at 11:06

You must log in to answer this question.

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