# Defining Data Field Formats

A description of Data Field Formats can be found in the main BriteLines overview document.

Data field formats are defined using YAML format in filed_formats/formats-0.1.yml file in the lines app. Each format has the following parameters:

  • Label - Unique text representation which will be displayed to users. E.g. Email Address
  • Classification - Unique dotted path that classifies the format as part of a group. E.g. string.personal.email
  • Default field values - An object with properties like name, label, type, validators, and options which are used as default values fields. It may contain any property which is a valid field for a data field.

Example Email Address field with an email validator:

formats:
  - label: Email Address
    classification: string.personal.email
    default_field_values:
      name: emailAddress
      label: Email Address
      type: string
      validators:
        - name: regex
          params:
            value: ^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$
1
2
3
4
5
6
7
8
9
10
11

Example Member Type enum field with 3 options:

formats:
  - label: Member Type
    classification: enum.personal.member_type
    default_field_values:
      name: memberType
      label: Member Type
      type: enum
      options:
        - label: Standard
          value: standard
          name: standard
        - label: Premium
          value: premium
          name: premium
        - label: Elite
          value: elite
          name: elite
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17