Attribute Types

Introduction

Attributes are the building blocks of your data models. They define the specific fields and data types that your records will contain. Cnidarity offers various attribute types to accommodate different kinds of research data, each with its own set of options and validation rules.

Choosing the right attribute type ensures data is captured correctly, validation is appropriate, and the user interface provides an optimal experience for data entry and display.

Cnidarity currently supports the following attribute types:

  • Text: For short text values
  • Text Area: For longer paragraphs of text
  • Number: For integer and decimal values
  • Date: For calendar dates
  • Boolean: For yes/no values
  • Select: For choosing a single option from a list
  • Multi-Select: For choosing multiple options from a list
  • Email: For email addresses with validation
  • URL: For web addresses with validation
When creating a model, you can add attributes during the initial setup or add them later through the model's attribute management page.

Text Attributes

Text attributes are used for storing short, single-line character-based data.

Text

Used for short pieces of text like names, codes, or brief descriptions.

Validation Options:

  • Required: Makes the field mandatory
  • Min Length: Sets minimum character length
  • Max Length: Sets maximum character length
  • Regex Pattern: Custom validation pattern

Common Uses:

  • IDs and reference codes
  • Names and titles
  • Short labels
  • Brief descriptions
For text that needs specific validation patterns (like email addresses or URLs), use the specialized Email or URL attribute types instead of a generic Text attribute with regex validation.

Text Area Attributes

Text Area attributes are used for storing longer, multi-line text content.

Text Area

Used for paragraphs of text like descriptions, notes, or observations.

Validation Options:

  • Required: Makes the field mandatory
  • Min Length: Sets minimum character length
  • Max Length: Sets maximum character length

Field Options:

  • Field Description: Brief text explaining the field (max 64 chars)
  • Field Hint: Instructions shown below the field (max 128 chars)

Common Uses:

  • Detailed descriptions
  • Notes and observations
  • Methodologies
  • Comments and feedback
Text Area fields provide a larger input area that allows users to write and format longer content comfortably. The standard height is 4 rows, which is automatically applied.

Number Attributes

Number attributes are used for numeric data that may require mathematical operations.

Number

Used for any numeric value, including integers and decimals.

Validation Options:

  • Required: Makes the field mandatory
  • Min Value: Sets minimum allowed value
  • Max Value: Sets maximum allowed value
  • Step: Increment for up/down controls (e.g., 0.01, 1, 5)

Field Options:

  • Field Description: Brief text explaining the field (max 64 chars)
  • Field Hint: Instructions shown below the field (max 128 chars)

Common Uses:

  • Measurements and quantities
  • Percentages
  • Ratings and scores
  • Counts and frequencies
When setting min/max values for number fields, ensure the minimum value is less than the maximum value. The system will automatically validate this relationship to prevent configuration errors.

Date Attributes

Date attributes are used for tracking temporal data like dates and timestamps.

Date

Used for calendar dates with optional time information.

Validation Options:

  • Required: Makes the field mandatory
  • Min Date: Earliest allowed date
  • Max Date: Latest allowed date

Field Options:

  • Field Description: Brief text explaining the field (max 64 chars)
  • Field Hint: Instructions shown below the field (max 128 chars)

Common Uses:

  • Event dates
  • Collection dates
  • Experiment schedules
  • Deadlines and due dates
Date fields provide a calendar picker interface for easy date selection. When setting min/max dates, the system verifies that the minimum date is earlier than the maximum date.

Boolean Attributes

Boolean attributes represent binary yes/no values.

Boolean (Yes/No)

Used for yes/no, true/false, or on/off values.

Validation Options:

  • Required: Makes the field mandatory

Field Options:

  • Field Description: Brief text explaining the field (max 64 chars)
  • Field Hint: Instructions shown below the field (max 128 chars)

Common Uses:

  • Status indicators (active/inactive)
  • Confirmation fields (agree/disagree)
  • Feature toggles (enabled/disabled)
  • Binary conditions (present/absent)
Boolean fields render as checkboxes in forms. They're ideal for simple yes/no questions where only two states are possible.

Select Attributes

Select attributes allow users to choose a single option from predefined choices.

Select

Used when users should choose one option from a list.

Required Settings:

  • Options: List of available choices (at least one required)

Validation Options:

  • Required: Makes the field mandatory

Field Options:

  • Field Description: Brief text explaining the field (max 64 chars)
  • Field Hint: Instructions shown below the field (max 128 chars)

Common Uses:

  • Categories and classifications
  • Status options
  • Predefined choices
  • Single-choice questions
Select fields render as dropdown menus by default. You must add at least one option when creating a Select attribute.

Multi-Select Attributes

Multi-Select attributes allow users to choose multiple options from a predefined list.

Multi-Select

Used when users should be able to select multiple options from a list.

Required Settings:

  • Options: List of available choices (at least one required)

Validation Options:

  • Required: Makes the field mandatory (at least one selection)

Field Options:

  • Field Description: Brief text explaining the field (max 64 chars)
  • Field Hint: Instructions shown below the field (max 128 chars)

Common Uses:

  • Multiple categories or tags
  • Feature sets
  • Multiple symptoms or conditions
  • Multi-answer questions
Multi-Select fields allow users to choose any number of options. When the field is required, users must select at least one option.

Email Attributes

Email attributes are specialized text fields for storing and validating email addresses.

Email

Used for capturing and validating email addresses.

Validation Options:

  • Required: Makes the field mandatory
  • Email Format: Automatically applied email validation

Field Options:

  • Field Description: Brief text explaining the field (max 64 chars)
  • Field Hint: Instructions shown below the field (max 128 chars)

Common Uses:

  • Contact information
  • Researcher email addresses
  • Institutional email contacts
Email attributes automatically include email format validation. This is more reliable than using a text field with custom regex validation.

URL Attributes

URL attributes are specialized text fields for storing and validating web addresses.

URL

Used for capturing and validating web addresses.

Validation Options:

  • Required: Makes the field mandatory
  • URL Format: Automatically applied URL validation

Field Options:

  • Field Description: Brief text explaining the field (max 64 chars)
  • Field Hint: Instructions shown below the field (max 128 chars)

Common Uses:

  • Website references
  • External resource links
  • Publication URLs
  • Repository links
URL attributes automatically include URL format validation, ensuring that input follows a proper web address format.

Best Practices

Follow these guidelines to effectively use attribute types in your data models:

  • Use Specialized Types: Choose specialized attribute types (like Email, URL) over generic text fields with custom validation
  • Set Appropriate Validation: Configure validation that ensures data quality without being unnecessarily restrictive
  • Be Clear with Labels and Descriptions: Use descriptive labels and helpful field descriptions to guide users
  • Consider Required Fields Carefully: Only mark fields as required when they're truly necessary for data integrity
  • Use Select Lists for Consistency: When there's a fixed set of possible values, use Select or Multi-Select attributes
  • Think About Filtering Needs: Consider how you'll need to filter and search your data when choosing attribute types
  • Organize Attributes Logically: Arrange attributes in a logical order that follows your data collection workflow

Pro Tip

If your model requires many attributes, consider breaking it into multiple related models. This makes forms more manageable and improves overall data organization.