# 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.

**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

### 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>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.keyfax.biz/product-suite/admin/entities/questions/dynamic-lists.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
