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
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
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
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
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
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)
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
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
Email Attributes
Email attributes are specialized text fields for storing and validating email addresses.
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
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
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