I have a custom metadata type and a field in it with a value. I am creating a formula field on an object(TestObject) where I would like to reference a value from the above custom metadata type into this formula. I know that in hierarchichal custom settings we can do this by $Setup.CustomSettingName__c.CustomFieldName__c

Could we do similar to that using Custom MetaData Type? Can we reference Custom MetaData type at all?

Thanks for the help!

4 Answers 4


Unfortunately, you can't reference custom metadata types in formulas at all. Their primary purpose is to provide metadata that's easy to package and transport between orgs, and primarily intended for use in Apex Code.

You can now reference custom metadata types in validation rules. To do so, specify the object name, record name, and field value:

  • Thanks for the info. I thought we can use it :( So the major difference between custom settings and custom metadata type is that we can deploy records for metadata type which we cannot do with custom setting. Commented Oct 27, 2016 at 16:10
  • 2
    Hey! Might want to update this answer, since now it is possible to reference CMDT in formulas. help.salesforce.com/… Commented Sep 17, 2018 at 19:45
  • @RenatoOliveira thanks for the note. It's really hard to keep track of all my answers for outdated info. I always appreciate help from others.
    – sfdcfox
    Commented Sep 17, 2018 at 19:55
  • And as of Winter 19, not just validation rules but also formula fields.
    – Charles T
    Commented Sep 17, 2018 at 20:32
  • FYI, if you try to reference the formula in a workflow field update it won't work.
    – NSjonas
    Commented Jan 10, 2020 at 5:30

You can reference CMT records in formula fields starting with the Winter '19 release.

It follows the same syntax as in validation rules:


Reference: http://releasenotes.docs.salesforce.com/en-us/winter19/release-notes/rn_forcecom_development_custom_metadata_types_ff.htm


We are adding support for custom metadata type in formulas. In Spring '18 you will be able to reference CMT records in validation rules (pilot) with the future addition of formula fields, default values, etc.




Good news. Salesforce team is working on adding support for Custom Metadata Types in formulas. It has been confirmed in the success forum:


  • That is good news. Custom Metadata could replace certain types of Custom Label usage that are less than ideal without the limitations of Custom Settings.
    – sfdcfox
    Commented May 15, 2017 at 17:22

You must log in to answer this question.

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