# Custom Field Types

## Overview

Custom Field Types (CFTs) are reusable field templates that help streamline the creation of Custom Data Types (CDTs) when you need to use the same field configuration across multiple CDTs. Instead of manually recreating the same field setup repeatedly, you can define a Custom Field Type once and then apply it to as many CDTs as needed.

Custom Field Types are particularly useful for maintaining consistency across your data model and reducing configuration time.

## Key Benefits

* **Reusability** – Define once, use in many CDTs
* **Consistency** – Ensure the same field types and options across your environment
* **Efficiency** – Eliminate duplicate data entry
* **Maintenance** – Update field definitions in one place
* **Examples**:
  * A "Yes/No" field type with consistent options used in 10 different assessments
  * A "Pain Scale" list (0-10) used in multiple clinical CDTs
  * A medication dosage formula used across medication-related CDTs
  * A "Priority Level" list with colors and values

## When to Use Custom Field Types

Use Custom Field Types when you have:

* **List fields** with the same predefined options (e.g., "Yes/No", "Low/Medium/High", "Never/Rarely/Sometimes/Always")
* **Formula fields** with the same calculation (e.g., BMI calculation, age from DOB)
* **URL fields** with the same validation or format
* **Select fields** with the same set of choices that appear in multiple assessments
* **Scoring scales** (e.g., Likert scales) that appear in multiple assessment tools

## Creating a Custom Field Type

### Step 1: Access Custom Field Types in Designer

1. Sign into Designer
2. Click **Create Draft** to start a new configuration draft
3. Navigate to **Custom Data** > **Custom Field Types** from the left sidebar
4. Click **+ New** in the upper right corner

### Step 2: Name Your Custom Field Type

Enter the following information:

1. **Title** – User-friendly name
   * Example: "Pain Severity Scale", "Yes/No Response"
   * This appears in dropdown lists when creating CDTs
2. **Name** – Internal system name (lowercase, numbers, underscores, hyphens)
   * Auto-populates from Title but can be customized
   * Example: `pain-severity-scale`
3. **Description** (optional) – What this field type is for
   * Example: "0-10 pain rating scale used in chronic pain assessments"

### Step 3: Select the Field Type and Configure Options

Choose the type of field this Custom Field Type represents:

#### List Field Type

**Use for:** Single-select dropdown options

**Configuration:**

1. Set **Type** = "List"
2. Set **Value Type** = (choose option):
   * **String** – for text-based options
   * **Integer** – for numeric values (useful for scoring)
   * **Float** – for decimal values
   * **Boolean** – for true/false
3. **Add Options** – Enter each option as a separate line

**Example: "Yes/No with Integer Values"**

```
Yes = 1
No = 0
Unknown = -1
```

**Example: "Likert Scale"**

```
Strongly Disagree = 1
Disagree = 2
Neutral = 3
Agree = 4
Strongly Agree = 5
```

**Example: "Pain Level"**

```
None = 0
Mild = 1
Moderate = 2
Severe = 3
Unbearable = 4
```

#### Multi-Select List Field Type

**Use for:** Multiple-select options where users can choose more than one

**Configuration:**

1. Set **Type** = "Multi-Select List"
2. Set **Value Type** = String or Integer
3. **Add Options** – Enter each option as a separate line

**Example: "Symptoms Checklist"**

```
Fatigue
Headache
Dizziness
Nausea
```

#### Formula Field Type

**Use for:** Calculated values based on mathematical expressions

**Configuration:**

1. Set **Type** = "Formula"
2. **Enter the Formula Expression**
   * Use placeholder syntax like `{{field1}}` and `{{field2}}`
   * Example: `({{weight}}/{{height}}) * 703` for BMI
3. Set **Return Type** = Integer or Float

**Example: "Age Calculation from DOB"**

```
Formula: (current_date - {{date_of_birth}}) / 365.25
Return Type: Integer
```

#### Text Field Types

**Use for:** Standard text, long text, email, phone, or URL formats

**Configuration:**

1. Set **Type** = "Text", "Long Text", "Email", "Phone Number", or "URL"
2. Set any additional validation rules if available
3. Add placeholder or example text if desired

**Example: "Email Address"**

```
Type: Email
Validation: Standard email format
```

### Step 4: Set Additional Properties

Configure any additional field properties:

1. **Required** – Check if this field must always be filled when used
2. **PHI (Protected Health Information)** – Check if this field contains sensitive data
3. **Help Text** (optional) – Guidance for users completing this field
4. **Placeholder Text** (optional) – Example text shown in empty field

### Step 5: Save and Publish

1. Click **Save** to save your Custom Field Type
2. Click **Publish** to make it available for use when creating CDTs

## Using Custom Field Types in CDTs

### When Creating a CDT

1. In Designer, create or edit a Custom Data Type
2. Click **+ Data Field**
3. Look for a dropdown or selector that shows **"Custom Field Types"**
4. Select your newly created Custom Field Type
5. The field automatically inherits:
   * All options/values
   * Data type configuration
   * Required/PHI status (if set)
   * Help text and placeholders
6. You can optionally override specific properties if needed
7. Click **Save** to add the field

**Example Workflow:**

Using "Pain Severity Scale" Custom Field Type:

1. Create CDT "pain\_assessment"
2. Click + Data Field
3. Select **Type** = "Custom Field Type" → "Pain Severity Scale"
4. Name the field "pain\_rating"
5. Field automatically gets 0-4 scale with "None/Mild/Moderate/Severe/Unbearable"
6. Save
7. Repeat in another CDT "migraine\_tracking" → also gets the same scale

## Benefits in Practice

### Before Custom Field Types

Creating assessment with 5 questions on a Likert scale:

* Manually enter "Strongly Disagree, Disagree, Neutral, Agree, Strongly Agree" five times
* Each field takes 2-3 minutes
* Total: 10-15 minutes, prone to typos

### After Custom Field Types

Creating assessment with 5 questions on a Likert scale:

* Select "Likert Scale" Custom Field Type five times
* Field auto-populates all options
* Total: 1-2 minutes, perfect consistency

## Best Practices

1. **Clear Naming** – Use names that describe what the field represents
   * ✓ Good: "Yes/No Response", "Pain Severity Scale", "Likert Scale 5-Point"
   * ✗ Poor: "List1", "Field Type A", "cft\_misc"
2. **Document Purpose** – Include descriptions explaining when to use
   * "Use for consent/agreement questions"
   * "Depression screening severity (PHQ-9 compatible)"
3. **Consistent Options** – Ensure option values match across uses
   * If "Likert Scale" always uses 1-5, don't create variants
   * Create separate types for different scales
4. **Value Assignment** – Always assign numeric values to scored lists
   * Makes scoring and calculations easier
   * Ensures consistency in automations
5. **Regular Review** – Periodically audit Custom Field Types
   * Remove unused types
   * Consolidate similar types
   * Update if standards change (e.g., new assessment scales)
6. **Naming Convention** – Follow your organization's naming standards consistently
7. **Version Control** – Document which assessment versions use which CFTs

## Limitations

* Custom Field Types cannot be modified after use in a CDT without affecting existing data
* If you need to change a CFT, you may need to create a new version
* Not all field types can be made into Custom Field Types (some require CDT-specific configuration)

## Examples of Commonly Used Custom Field Types

### Healthcare Examples

1. **Likert Scales** – 5-point agreement scales used in many assessments
2. **Yes/No Fields** – Binary responses in screening tools
3. **Pain Rating Scale** – 0-10 or 0-4 numeric scales
4. **Risk Level** – Low/Medium/High for risk assessments
5. **Frequency Scales** – Never/Rarely/Sometimes/Often/Always
6. **Outcome Measures** – Standardized scales like PHQ-9, GAD-7 response options

### Operational Examples

1. **Priority Levels** – Critical/High/Medium/Low for task management
2. **Status Options** – Active/Inactive/Pending/Completed
3. **Department Names** – Reference to standard departments
4. **Location/Facility List** – Standard clinic or facility names

## Related Topics

* [Custom Data Types (CDT): Designer](/designer/custom-data-types/custom-data-types-cdt-designer.md) – Creating CDTs that use CFTs
* [Create Formulaic Custom Data Type Fields](/designer/custom-data-types/create-formulaic-custom-data-type-fields.md) – Formula field types
* [How to Create an Assessment or Form Template](/designer/documents-and-assessments/how-to-create-an-assessment-or-form-template.md) – Using CDTs with CFTs in forms
* [Designer: How to Configure Scored Assessments](/designer/documents-and-assessments/designer-how-to-configure-scored-assessments.md) – Scoring with list options
* [Welkin Naming Conventions Dictionary](/designer/terminology-and-help/welkin-naming-conventions-dictionary.md) – Naming standards


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.welkinhealth.com/designer/custom-data-types/custom-field-types.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
