FormWork FormWork

Using as Options Source

Power dropdown and select fields with data table values.

Data tables can serve as dynamic option sources for select, radio, and multiselect fields. This lets you manage options centrally and keep them in sync across forms.

Setting Up Options Data Source

Configure a Select Field

  1. Select a select, radio, or multiselect field
  2. In field settings, find Options Source
  3. Choose Data Table
  4. Select the table and columns

Configuration Options

SettingDescription
Source TableWhich data table to use
Label ColumnColumn to display as option text
Value ColumnColumn to store as answer value
FilterOptional filter for which rows to include

Basic Example

Data Table: Categories

IDNameActive
cat_1Electronicstrue
cat_2Clothingtrue
cat_3Bookstrue
cat_4Discontinuedfalse

Field Configuration

{
  "type": "select",
  "label": "Category",
  "options_data_source": {
    "source_reference": "data_table:categories.rows",
    "label_reference": "name",
    "value_reference": "id"
  }
}

Result

Dropdown shows:

  • Electronics
  • Clothing
  • Books
  • Discontinued

Filtering Options

Basic Filter

Only show active categories:

{
  "options_data_source": {
    "source_reference": "data_table:categories[active=true].rows",
    "label_reference": "name"
  }
}

Dynamic Filter

Filter based on another field:

{
  "options_data_source": {
    "source_reference": "data_table:products[category={{ entry.answers.category }}].rows",
    "label_reference": "name"
  }
}

When the category field changes, products update.

Label and Value Configuration

Simple Reference

Use a column directly:

{
  "label_reference": "name",
  "value_reference": "id"
}

Same Column

Use the same column for both:

{
  "label_reference": "country_name",
  "value_reference": "country_name"
}

Reference Is Simple Value

When the data source is an array of values (not objects):

{
  "source_reference": "data_table:tags.rows|pluck:name",
  "reference_is_simple_value": true
}

Use Cases

Country Selection

Data Table: countries

codename
USUnited States
CACanada
UKUnited Kingdom

Field:

{
  "type": "select",
  "label": "Country",
  "options_data_source": {
    "source_reference": "data_table:countries.rows",
    "label_reference": "name",
    "value_reference": "code"
  }
}

Dependent Dropdowns

Country → State selection

First field (Country) uses countries table.

Second field (State):

{
  "type": "select",
  "label": "State",
  "options_data_source": {
    "source_reference": "data_table:states[country={{ entry.answers.country }}].rows",
    "label_reference": "name",
    "value_reference": "code"
  },
  "conditional_logic": {
    "type": "all",
    "groups": [{
      "type": "all",
      "rules": [{ "field": "country", "operator": "is_not_empty" }]
    }]
  }
}

Product Selection with Details

Data Table: products

idnamepricein_stock
p1Widget29.99true
p2Gadget49.99true
p3Gizmo19.99false

Only in-stock products:

{
  "source_reference": "data_table:products[in_stock=true].rows",
  "label_reference": "name",
  "value_reference": "id"
}

Workflow to get price:

price = data_table:products[id={{ entry.answers.product }}].price

Refreshing Options

When Options Update

  • On field focus (lazy loading)
  • When dependent field changes
  • On page load

Caching

Options may be cached for performance:

  • Changes to data table may take a moment to appear
  • Force refresh by re-loading the form

Best Practices

Keep Tables Focused

Create purpose-specific tables:

  • product_categories for category dropdowns
  • us_states for US address fields
  • pricing_tiers for pricing selection

Use Meaningful Values

Store values that:

  • Are stable (won’t change)
  • Are useful in workflows
  • Can be joined with other data

Plan for Growth

Consider:

  • How many options will there be?
  • Will filtering be needed?
  • How often will data change?

Test with Data Changes

Verify that:

  • New options appear
  • Removed options stop appearing
  • Filtered options update correctly