> For the complete documentation index, see [llms.txt](https://docs.keyfax.biz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.keyfax.biz/product-suite/admin/entities/questions/dynamic-lists.md).

# Dynamic Lists

{% embed url="<https://youtu.be/sFgV79LGaiU>" %}

This question type allows a list of options to be dynamically presented to the operator by using a key value, either passed to Keyfax in the Start-up XML (for example TenantID, AssetID, Tenancy) or picked up within the scripts and stored in a Databox. A value is returned dependant on the operator’s selection, which can in turn be written to a databox for subsequent use.

<div align="center"><figure><img src="/files/GcOQmIPsGVBObWwerBL9" alt=""><figcaption><p>Example Dynamic List</p></figcaption></figure></div>

### Properties

**Admin Display** - a descriptive name to identify the Question.

**Operator Display** - the Question text as displayed to the Operator.

**Display all items** – If checked then display all items on the page, if not checked then the operator will need to scroll if there are more options than defined in the “Scroll items per page” value.

**Scroll items per page** – number of items displayed before the operator needs to scroll.

**Database** – Select which database is being queried

**SQL Query** – Build the SQL to query the selected database

**Test** – Test the SQL entered in SQL Query

**Value column** – column of the table in the database from which a value will be returned dependant on the option selected by the operator.  This field is case sensitive.

**Record value** - if checked the value will be added to the recorded text.

**Display column(s)** – Column of table in the database from which a value will be displayed to the operator. This field is case sensitive.

{% hint style="info" %}
Both the Value and Display column fields are case sensitive.  Entering a field name with the wrong case (i.e. one that does not match the result data coming from the SQL or the databox, whether SQL or HTTP) can result in the dynamic list question displaying no answer options.
{% endhint %}

### Testing your Dynamic List

Clicking **Test** will present a dialogue showing the results of the SQL query. In this case, the selection of '**Black**' will return a code of '**4**', for further use in your scripts:

<div align="center"><figure><img src="/files/eRSTrtWEcakrRCkiqUvx" alt=""><figcaption></figcaption></figure></div>

### User Experience

This shows 5 rows returned by the SQL query with a scroll bar added

<div align="center"><figure><img src="/files/peNiljT1fPKUaJ8RTGaH" alt=""><figcaption><p>Example Dynamic List</p></figcaption></figure></div>

The code representing the choice made can be written to a Databox for subsequent use, .e.g.

<div align="center"><figure><img src="/files/F570p6XD6rKtCJqsVuLO" alt=""><figcaption></figcaption></figure></div>
