Validation options

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.

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.

Learn more about creating a metafield definition with validation options and refer the to table below for more examples.