Pricing
← Back to Tutorials
Getting started

Refine Your App: From Free-Text Fields to Dropdowns

Applies to 1.0.1604-

What we will do

By the end of this tutorial, the free-text status, priority, impact and source fields in our Help Desk app will be proper dropdowns backed by their own lookup tables — so every ticket gets a consistent, filterable, reportable value. Along the way you'll learn the refinement loop that works on any app: add a lookup table, convert the column, link the relationship, verify the result.

By the end of this tutorial, the free-text status, priority, impact and source fields in our Help Desk app will be proper dropdowns backed by their own lookup tables — so every ticket gets a consistent, filterable, reportable value. Along the way you'll learn the refinement loop that works on any app: add a lookup table, convert the column, link the relationship, verify the result.

Where we left off

Our schema was generated from a plain-language prompt: nine tables covering departments, categories, SLA policies, tickets and their comments. It works — but fields like status and priority are free text, which means "High", "high" and "HIGH" are three different values, and nothing stops anyone from typing nonsense. Let's fix that.

Step 1 — Open the schema editor

From My Apps, open the Help Desk card and click Edit Schema. Because the app already has a schema and a permanent database link, the wizard skips database selection and basic info entirely and drops you straight onto Schema Fields — you're editing, not starting over.

Step 2 — Add the lookup tables

The left sidebar lists your nine existing tables, marked Existing. Click + Add in the Tables panel: a dialog asks for a snake_case name. Create your first lookup table — ticket_status — then repeat for ticket_priority, ticket_impact and ticket_source. Lookup tables are tiny on purpose: they hold the list of allowed values, nothing more.

Each lookup table gets the same four fields: id (BIGINT, PK, Auto-increment), name (VARCHAR 255 — the value users will pick), description (optional context), and in_use (TINYINT). Toggle Advanced Mode to see the full column options — length, null, default, unique, index. The in_use flag lets you retire an option later without breaking tickets that already use it.

Step 3 — Convert the ticket status column

Open the Ticket table and find the four free-text columns. Change status from VARCHAR to INT — that integer will reference the id of a row in ticket_status. The screenshot shows status converted (highlighted); repeat the same conversion for priority, impact and source. Leave the column names as they are — status stays status.

Changing a column's type on a table that already contains data is a migration: existing text values won't automatically become the right ids. This is flagged as a potentially destructive change in the Review step. Do refactors like this while tables are empty (ours is), or plan the data migration first.

Step 4 — Convert the ticket status column in UI

Then modify the UI field for ticket_status_id in select

Step 5 — Final schema

Check the final new schema with the new ticket_status table and new ticket_status_id field in tickets

Related resources

← Back to Tutorials Start building — free trial