Enumeration Data Type

User Guide: Object Services > Enumeration Data Type

Enumeration Data Type

A field with the Enumerated/enum data type enables you to configure a set of values/options for that field. So the enum data type field restricts app users to enter/select only the pre-configured list of options as the input for that field.

Use cases:

  • In the Contact form, the State field needs to be a pre-configured list of 50 States of America. This enables the app users to choose only one of the available values from the list.
  • A Priority field can have enumeration options as Critical, High, Medium, and Low.
  • A Gender field can have only Male and Female as valid values.

How to configure enum data type for a field:

  1. In Volt MX Foundry Console, create an object in the Data Model of an object service, for example Address.
  2. Select the Fields node under the Address object and click Add to create a field.
  3. Under the NAME column, specify the field name, for example, State.
  4. Under the TYPE column, select the data type as enum. The string data type is selected by default.

    The Enumeration Details dialog box appears.

    1. Under the Enum Option text box, enter the details and then type comma or space bar on your keyboard. These values are updated in the text box. Refer to Enum data type samples, in the next section.

      Note: You can also copy and paste the comma-separated text into the text box.

      Note: The number of enumeration options allowed is up to a maximum of 50.

    2. Click SAVE to save the details and close the dialog box.
      Use the Edit button shown next to the enum data type to modify the data, if required.

  5. Click SAVE to save to the field.

Enum data type samples

  • You can configure the enumeration options as a comma-separated set of values, as shown:

    Example Output
    Critical, High, Medium, Low





  • You can configure the enumeration options in Text with special characters within quotes (single/double) and comma-separated, as shown:

    Option Input for the Enum field in Console - Examples Output in the form of an app
    option 1 "Critical", "High", "Medium", "Low"





    option 2 "Orlando FL", "Edison NJ", "Austin TX", "Cupertino CA"

    "Orlando FL"

    "Edison NJ"

    "Austin TX"

    "Cupertino CA"

    option 3

    "Orlando, FL", "Edison, NJ", "Austin, TX", "Cupertino, CA

    "Orlando, FL"

    "Edison, NJ"

    "Austin, TX"

    "Cupertino, CA"

    option 4

    'Orlando FL', 'Edison NJ', 'Austin TX', 'Cupertino CA'

    'Orlando FL'

    'Edison NJ'

    'Austin TX'

    'Cupertino CA'

    option 5

    'Orlando, FL', 'Edison, NJ', 'Austin, TX', 'Cupertino, CA'

    'Orlando, FL'

    'Edison, NJ'

    'Austin, TX'

    'Cupertino, CA'