Field Types

TypeDescriptionValidation Options
textSingle-line string inputmin/max length, regex pattern, custom error message
textareaMulti-line textmax length, word count limit
numberNumeric input with optional stepmin, max, step, integer-only flag
dateDate picker (calendar UI)min date, max date, relative offsets (e.g. today+7)
datetimeDate + time picker with timezonetimezone, min/max datetime
dropdownSingle-select from a fixed or connector-backed listrequired, static options array or connector reference
multiselectMultiple selections from a listmin selections, max selections
checkboxBoolean togglerequired (must be checked to advance)
fileFile upload (stored as attachment on case)MIME type whitelist, max file size (MB)
rich_textFormatted text editor (bold, lists, links)max character count
lookupSearch + select from a platform entity (user, case, access group)entity type (user/case/access_group), search field
calculatedRead-only computed value — formula evaluated at render timeexpression (JS subset, see below)
signatureFreehand signature canvas — saves as base64 PNGrequired, min stroke count
ratingStar or numeric rating inputmin/max rating, step

Building a Form in Studio

  1. Open the Case Type editor in Studio. Select a stage, then click a step to expand it.

  2. Click "Add Form" or select an existing form from the dropdown. A form can be shared across steps or unique to one step.

  3. Add fields using the "+ Add Field" button. Choose the field type, set a unique field key (e.g. customer_email), display label, placeholder, and whether it is required.

  4. Set validation rules in the field's Validation tab. Add a custom error message so users understand what's expected.

  5. Add visibility conditions to show or hide fields based on other values (see below).

  6. Drag to reorder fields. The order in the editor matches the rendering order in the Work Center.

  7. Save the form. Changes take effect on the next page load for open cases (no migration needed for form-level changes).

Visibility Conditions

Each field carries an optional visibility condition — a boolean expression that controls whether the field is rendered. Fields that are hidden are also excluded from validation and submission.

PatternExample ExpressionNotes
Field equals valuecategory == "complaint"Use == (not ===)
Field is not emptyattachment != nullAlso works: attachment != ""
Role checkrole in ["agent","manager"]role is the acting user's role
Numeric comparisonamount > 10000Fields referenced by key, not label
Compound ANDpriority == "high" && role == "manager"Use && and ||
Stage checkstage == "Review"Show only during a specific stage
Reference fields by key, not label. Use customer_email, not "Customer Email". The key is set when you create the field and must be unique within the form.

Calculated Fields

Calculated fields evaluate a JavaScript-subset expression at render time. They are read-only and update live as other field values change.

ExpressionResult
quantity * unit_priceNumeric product of two fields
amount * 1.2Fixed multiplier (e.g. add 20% tax)
first_name + " " + last_nameString concatenation
new Date(due_date) > new Date() ? "Overdue" : "On time"Conditional string
Allowed: arithmetic operators, string concat, ternary, new Date(), Math.*, field references. Not allowed: fetch, eval, setTimeout, DOM access, or imports.

Connector-Backed Dropdowns

A dropdown or multiselect field can load its options dynamically from an external API via an HttpCustomConnector.

  1. Create an HttpCustomConnector in Studio > HxConnect > Custom Connectors. Set the URL to the API endpoint that returns a list of options (must return JSON array).

  2. In the field configuration, set Source to Connector and choose the connector. Map the response field that contains the label and the field that contains the value.

  3. Options are fetched when the form loads and cached for the session. Add a depends_on field key if the options should reload when another field changes (e.g. state dropdown reloads when country changes).

How Form Data Is Stored

Field values are written through the case-variables façade into case_instance_variables, one typed row per (case, full_key). Older cases whose values still live in the legacy data JSONB column on case_instances keep working — the façade merges that blob in as a fallback on read, so both shapes answer the same query. Either way you can add new fields to a form without a schema migration.

-- Query cases where a JSONB field equals a value
SELECT id, ref, data->>'customer_email' FROM cases
WHERE data @> '{"priority": "high"}'
  AND status = 'open';
Indexing tip: Add a GIN index on cases.data for fast JSONB containment queries: CREATE INDEX idx_cases_data ON cases USING GIN (data);