Forms collect structured data at every stage and step of a case. Every field type, visibility rule, and validation option is configurable in Studio without writing code.
| Type | Description | Validation Options |
|---|---|---|
text | Single-line string input | min/max length, regex pattern, custom error message |
textarea | Multi-line text | max length, word count limit |
number | Numeric input with optional step | min, max, step, integer-only flag |
date | Date picker (calendar UI) | min date, max date, relative offsets (e.g. today+7) |
datetime | Date + time picker with timezone | timezone, min/max datetime |
dropdown | Single-select from a fixed or connector-backed list | required, static options array or connector reference |
multiselect | Multiple selections from a list | min selections, max selections |
checkbox | Boolean toggle | required (must be checked to advance) |
file | File upload (stored as attachment on case) | MIME type whitelist, max file size (MB) |
rich_text | Formatted text editor (bold, lists, links) | max character count |
lookup | Search + select from a platform entity (user, case, access group) | entity type (user/case/access_group), search field |
calculated | Read-only computed value — formula evaluated at render time | expression (JS subset, see below) |
signature | Freehand signature canvas — saves as base64 PNG | required, min stroke count |
rating | Star or numeric rating input | min/max rating, step |
Open the Case Type editor in Studio. Select a stage, then click a step to expand it.
Click "Add Form" or select an existing form from the dropdown. A form can be shared across steps or unique to one step.
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.
Set validation rules in the field's Validation tab. Add a custom error message so users understand what's expected.
Add visibility conditions to show or hide fields based on other values (see below).
Drag to reorder fields. The order in the editor matches the rendering order in the Work Center.
Save the form. Changes take effect on the next page load for open cases (no migration needed for form-level changes).
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.
| Pattern | Example Expression | Notes |
|---|---|---|
| Field equals value | category == "complaint" | Use == (not ===) |
| Field is not empty | attachment != null | Also works: attachment != "" |
| Role check | role in ["agent","manager"] | role is the acting user's role |
| Numeric comparison | amount > 10000 | Fields referenced by key, not label |
| Compound AND | priority == "high" && role == "manager" | Use && and || |
| Stage check | stage == "Review" | Show only during a specific stage |
customer_email, not "Customer Email". The key is set when you create the field and must be unique within the form.Calculated fields evaluate a JavaScript-subset expression at render time. They are read-only and update live as other field values change.
| Expression | Result |
|---|---|
quantity * unit_price | Numeric product of two fields |
amount * 1.2 | Fixed multiplier (e.g. add 20% tax) |
first_name + " " + last_name | String concatenation |
new Date(due_date) > new Date() ? "Overdue" : "On time" | Conditional string |
new Date(), Math.*, field references. Not allowed: fetch, eval, setTimeout, DOM access, or imports.A dropdown or multiselect field can load its options dynamically from an external API via an HttpCustomConnector.
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).
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.
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).
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';
cases.data for fast JSONB containment queries: CREATE INDEX idx_cases_data ON cases USING GIN (data);