I want all the index fields of a particular object in apex. I have searched through the Schema describe but couldn't find a way to identify the field as indexed.

  • You can get the external ids ¿Why do you want to know all the index fields?
    – Torsen
    Dec 18, 2017 at 7:25

1 Answer 1


It's not in the describe, but you can query the FieldDefinition via the Tooling API and it has an IsIndexed field.

List<FieldDefinition> indexedAccountFields = [
    SELECT QualifiedApiName FROM FieldDefinition WHERE IsIndexed = true
    AND EntityDefinition.QualifiedApiName = 'Account'

You must log in to answer this question.

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