Skip to content


Metadata is intended for: storing system data such as entity's fields and relationships; specifying frontend controllers, views, panels; defining fields, dashlets; and other data needed for the application.

How to access


Metadata object of Espo\Core\Utils\Metadata class can be accessed from Container. Path to a needed parameter is specified with an array.

$metadata->get(['entityDefs', 'Account', 'fields', 'name', 'type'])

will return 'varchar'.

$metadata->get(['entityDefs', 'Account', 'fields'])

will return an associative array with definitions of all fields.


Metadata object is accessible from all view objects by method #getMetadata. It works the same way as backend's one.

this.getMetadata().get(['entityDefs', 'Account', 'fields', 'name', 'type'])

How it's stored

Metadata is stored in JSON files that can be located in different places:

  • application/Espo/Resources/metadata/
  • custom/Espo/Custom/Resources/metadata/
  • application/Espo/Modules/{MODULE_NAME}/Resources/metadata/

When you access data by path clientDefs.Account.views.edit the first lexeme clientDefs corresponds to dir name, the second Account to file name Account.json. All following lexemes correspond to path in the JSON.

  "views": {
    "edit": "crm:views/account/views/edit" 

All JSON files from these directories get merged recursively into a single php array and stored in a cache file.


Since metadata is merged recursively you can easily redefine json objects and arrays in custom and in your module. Also you can append to existing arrays by using __APPEND__ (since version 2.6.0) as the first element of array.


  "fields": {
    "employeeCount": {
      "type": "int"
    "type": {
      "options": ["__APPEND__", "Dealer", "Lawyer"]