# Dynamic

The **Dynamic List** field is an input component used to display a **dropdown list populated dynamically from database data**.\
Unlike a static Listbox, the values shown in a Dynamic List are **retrieved at runtime** and can change based on conditions or dependencies.

This field is useful when dropdown values must reflect **live data** or depend on **other field selections**.

***

### Purpose of Dynamic List

The Dynamic List field is designed to:

* Display dropdown values retrieved from database tables
* Support dynamic filtering based on conditions
* Enable cascading or dependent dropdown behavior
* Ensure data consistency with master/reference tables

#### Typical Use Cases

* Country / Province / City selection
* Category / Sub‑category selection
* Reference data (e.g. Products, Departments, Roles)
* Context‑dependent dropdown lists

***

### Adding and Configuring a Dynamic List

To add a Dynamic List field:

1. Drag the **Dynamic List** field into a Module layout
2. Click the **Edit (pencil) icon** on the field
3. The **Dynamic List Configuration** window opens

<figure><img src="https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2FAhQAB1yQIrPPHHlmSoCa%2Fimage.png?alt=media&#x26;token=3aa696d1-6e09-4165-b6d7-176b4881a1e5" alt=""><figcaption></figcaption></figure>

***

### Dynamic List Configuration Properties

#### 1️. Core Identification

| Property  | Mandatory | Description                        |
| --------- | --------- | ---------------------------------- |
| **MF ID** | Yes       | System‑generated unique identifier |

***

#### 2️. Field Behavior

| Property          | Description                                                      |
| ----------------- | ---------------------------------------------------------------- |
| **Default Value** | Initial selected value                                           |
| **Source Tag**    | JavaScript injected at field level (e.g. `readonly`, `onchange`) |

***

#### 3️. Data Source Definition

These properties define how the dropdown data is retrieved from the database.

| Property         | Mandatory | Description                                 |
| ---------------- | --------- | ------------------------------------------- |
| **Table Name**   | Yes       | Database table used as the data source      |
| **Column Show**  | Yes       | Column whose value is displayed to the user |
| **Column Value** | Yes       | Column whose value is stored when selected  |
| **Condition**    | No        | SQL condition to filter retrieved records   |

***

#### 4️. Dependency Configuration (Cascading Dropdown)

Dynamic List supports dependency on other fields.

| Property            | Description                                        |
| ------------------- | -------------------------------------------------- |
| **Global ID**       | Global field identifier for dependency resolution  |
| **Dependency Data** | Enables dependent data behavior                    |
| **Depend Column**   | Column whose value depends on another field        |
| **Sequence**        | Defines evaluation order for multiple dependencies |

This allows creation of **cascading dropdowns**, where options change based on prior selections.

***

#### 5️. Database Mapping

| Property      | Description                          |
| ------------- | ------------------------------------ |
| **Field\_ID** | Database column mapped to this field |

***

#### 6️. Display & Condition Tab Settings

| Property          | Description                                              |
| ----------------- | -------------------------------------------------------- |
| **ShowFieldName** | Label displayed on the screen (auto‑generated supported) |
| **Condition Tab** | Enables triggering of conditional tab behavior           |

***

#### 7️. Search Configuration

| Property              | Description                            |
| --------------------- | -------------------------------------- |
| **SearchCriteria**    | Enables field as search criteria       |
| **ShowSearch**        | Displays field in search result table  |
| **SearchFromTo**      | Enables range search                   |
| **SearchPreLike**     | Enables wildcard `%XXX` search         |
| **SearchLike**        | Enables wildcard `XXX%` search         |
| **SearchIgnoreCase**  | Case‑insensitive search                |
| **JoinSearchTable**   | Used when JOIN SQL is required         |
| **SearchFieldGroup**  | Horizontal position in search criteria |
| **SearchCriteriaSeq** | Vertical position in search criteria   |
| **ShowSearchSeq**     | Order in search results                |

***

#### 8️. UI & Behavior Flags

| Property        | Description                               |
| --------------- | ----------------------------------------- |
| **Alignment**   | Text alignment: Left / Center / Right     |
| **OnlyGuiFlag** | UI‑only field (not persisted to database) |
| **ViewFlag**    | Displays field in read‑only mode          |
| **KeepHistory** | Persists value change history             |
| **FilterFlag**  | Filters records in 1‑Many modules         |
| **Authen**      | Applies IAM‑based authorization           |
| **MergeFlag**   | Field spans across multiple columns       |

***

#### 9️. Validation Rules (Validate Code)

| Code                 | Description                      |
| -------------------- | -------------------------------- |
| `CHECK_NULL`         | Prevents saving if value is null |
| `CHECK_INTEGER`      | Ensures integer value            |
| `CHECK_DECIMAL`      | Ensures decimal value            |
| `CHECK_EMAIL_FORMAT` | Validates email format           |

***

### Usage Guidelines

* Use Dynamic List when dropdown values come from **database tables**
* Prefer Dynamic List over Listbox for frequently changing data
* Ensure **Column Value** and **Column Show** are clearly defined
* Use dependencies carefully to avoid circular logic
* Test cascading behavior across all scenarios
* Apply validation rules to prevent invalid data selection

***

### Summary

The **Dynamic List** field enables powerful and flexible **data‑driven dropdown selection** in ONEWEB Smart Forms.

Key points:

* Loads dropdown values dynamically from database
* Supports conditional and dependent data
* Enables cascading dropdown scenarios
* Fully integrates with search, validation, and IAM
* Ensures consistency with live reference data

When used correctly, Dynamic Lists greatly enhance **data accuracy, flexibility, and user experience** in enterprise Smart Forms.


---

# 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.onewebstack.com/designer-reference/app-designer/entity/create-new-entity/fields/dynamic.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.
