Option Set

Introduction

An Option Set is a way to define a set of predefined values (options). Option Sets are often used to represent enumerated values or a fixed set of choices. It provides a predefined list of values.

Each option in an Option Set can have associated attributes that provide additional features or information about that specific option. This allows for a more nuanced representation of the data and enhances the flexibility of using Option Sets.

Key Components of Option Set

Name:

  • Every optionset is uniquely identified by a name within the API.

Description

  • Here you can give a detailed and informative explanation or representation of Optionset. It is a narrative that provides additional information to help understand, identify, or explain about the optionset.

Documentation

  • Allows users to document and store information about specific Optionset in the project. Write notes, explanations, or guidelines related to Optionset. Facilitates collaboration by providing a shared space for notes and documentation.

Options:

  • Options are the individual values or items within an Option Set.
  • They represent the possible choices or values that can be associated with an input parameter.

Key Components of Options:

Display:

  • Determines how the option is displayed in all other objects or on client side.

Attributes:

  • Attributes are additional features or pieces of information associated with an option in an Option Set.
  • They provide extra details or functionality to enhance the representation of the options.

Key Components of Attributes:

Name:

  • The name of the attribute serves as its identity within the option set.

Type:

  • The type of a attribute specifies the kind of data it can hold. It can be a primitive data type or an option set.

This attribute is a list (multiple Entries):

  • This property in option set attribute indicates that a particular property can hold multiple values, essentially turning it into a list or an array. This is useful when a property needs to represent a collection of items rather than a single value.

Required

  • The "required" property in option set attribute specifies whether a particular attribute must have a value assigned. If a attribute is marked as required, it means that when creating or updating an object based on this option set, a value for this property must be provided, and leaving it empty would result in a failure, ensuring essential data is captured.
Option Sets:
  - name: "Countries"
    attributes:
      - name: "timezone"
        type: "String"
        collection: true
      # ... other attributes
    values:
      - id: 1
        name: "USA"
        attributes:
          timezone: "UTC-5"
      - id: 2
        name: "Japan"
        attributes:
          timezone: "UTC+9"
      # ... other countries

Duplicate, Edit, Delete in Option Sets:

  • Duplicate: Option, Attribute: To duplicate any of these elements, navigate to the respective section in the Option set editor, locate the item you want to duplicate, and use the provided options to duplicate it.

  • Edit: Option, Attribute: To edit any of these elements, navigate to the respective section in the option set editor, locate the item you want to edit, and tap on the item's header then it will expand to edit and update it.

  • Delete: Option, Attribute: To delete any of these elements, navigate to the respective section in the option set definition, locate the item you want to delete, and use the provided options to remove it.

In summary, Option Sets in D3E Studio are a valuable tool for developers to define, manage, and utilize predefined sets of options in their applications. They contribute to a more structured, consistent, and user-friendly experience, ultimately enhancing the overall quality and usability of the software.