Metafield definitions can have validation options. Validation options enable you to apply additional constraints to the data that a metafield can store, such as a minimum or maximum value, or a regular expression. The type of the metafield definition determines which validation options are available. ## How it works You can include a validation option for a metafield definition using the validation `name` and a corresponding `value`. The appropriate value depends on the metafield type that the validation applies to. For more information about the supported formats and units of measurement available for each type, refer to [Metafield types](/docs/apps/build/custom-data/metafields/list-of-data-types). ## Supported validation options The following table describes the validation options available for metafield definitions. Refer to the [examples](#examples) for validation option code snippets. | Validation option | Description | Supported types | Use cases | |---|---|---|---| | [Minimum length](#minimum-length) | Sets the minimum length of a text value | | | | [Maximum length](#maximum-length) | Sets the maximum length of a text value | |