# Hidden

The **Hidden** field is used to store **hidden values** within a Smart Form.\
It is not visible to end users but plays an important role in **data handling, internal logic, and process integration**, such as storing IDs, keys, or system‑controlled values.

Hidden fields are commonly used to maintain contextual or technical data without exposing it on the UI.

***

### Purpose of Hidden Field

The Hidden field is designed to:

* Store internal identifiers (e.g. primary keys, foreign keys)
* Maintain system‑generated or derived values
* Support data manipulation without user interaction
* Pass values between UI, process, and backend logic
* Support filtering and search functionality in background

Although invisible on the screen, Hidden fields are often **critical to correct data persistence and process behavior**.

***

### Adding and Configuring a Hidden Field

To add a Hidden field:

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

<figure><img src="https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2Fk2UuuWHqv11GmlaZG11a%2Fimage.png?alt=media&#x26;token=3a575950-e084-4ad0-9a35-74f70ede6eb1" alt=""><figcaption></figcaption></figure>

***

### Hidden Field Configuration Properties

The following table describes all available configuration properties for the Hidden field.

| Property              | Mandatory | Description                                                                             |
| --------------------- | --------- | --------------------------------------------------------------------------------------- |
| **MF ID**             | Yes       | System‑generated unique identifier                                                      |
| **Source Tag**        | No        | Allows custom JavaScript at field level (e.g. `readonly`, `onchange=validateNum(this)`) |
| **Default Value**     | No        | Default value assigned to the field                                                     |
| **Field\_ID**         | No        | Database column mapped to this field                                                    |
| **ShowFieldName**     | Yes       | Logical field name; auto‑generated when clicking the blue icon                          |
| **SearchCriteria**    | No        | Marks the field as a search criterion                                                   |
| **ShowSearch**        | No        | Displays this field in search result table                                              |
| **SearchFromTo**      | No        | Enables range‑based search                                                              |
| **SearchPreLike**     | No        | Enables wildcard search (e.g. `%XXX`)                                                   |
| **SearchLike**        | No        | Enables wildcard search (e.g. `XXX%`)                                                   |
| **SearchIgnoreCase**  | No        | Enables case‑insensitive search                                                         |
| **JoinSearchTable**   | No        | Used when JOIN SQL is required for search                                               |
| **SearchFieldGroup**  | No        | Horizontal position in search criteria                                                  |
| **SearchCriteriaSeq** | No        | Vertical position in search criteria                                                    |
| **ShowSearchSeq**     | No        | Position in search results                                                              |
| **Alignment**         | No        | Text alignment: Left / Center / Right                                                   |
| **OnlyGuiFlag**       | No        | UI‑only field (not persisted to database)                                               |
| **ViewFlag**          | No        | Displays field in view/read mode                                                        |
| **KeepHistory**       | No        | Persists value history in database                                                      |
| **FilterFlag**        | No        | Used in 1‑Many Modules for filtering records                                            |
| **Authen**            | No        | Applies IAM‑based authorization                                                         |
| **MergeFlag**         | No        | Merges field across multiple columns                                                    |
| **Validate Code**     | No        | Validation logic (e.g. `CHECK_NULL`, `CHECK_INTEGER`, `CHECK_EMAIL_FORMAT`)             |

***

### Validation Options (Validate Code)

The **Validate Code** property supports built‑in validation rules, such as:

* `CHECK_NULL` – Prevents saving when value is null
* `CHECK_INTEGER` – Ensures integer input
* `CHECK_DECIMAL` – Ensures decimal input
* `CHECK_EMAIL_FORMAT` – Validates email format

These validations are applied even though the field is hidden.

***

### Authorization (Authen)

When **Authen** is enabled:

* Hidden field behavior is controlled by ONEWEB’s IAM
* Useful for role‑based or conditional logic
* Common in workflows or secured entity designs

***

### Usage Guidelines

* Use Hidden fields for **technical or system values**
* Do not use Hidden fields for user input
* Always document the purpose of each Hidden field
* Use `OnlyGuiFlag` when the value should not be persisted
* Be cautious when using Hidden fields in Search or Filter logic
* Avoid excessive Hidden fields to reduce complexity

***

### Summary

The **Hidden** field is a non‑visual but fundamental component in ONEWEB Smart Forms.

Key points:

* Stores invisible system or contextual data
* Can be mapped to database columns or UI‑only logic
* Supports validation, search, and filtering
* Integrates with IAM authorization
* Essential for IDs, keys, and background processing

Correct use of Hidden fields ensures Smart Forms remain **robust, secure, and functionally complete**, even when complex backend logic is required.


---

# 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/oneweb-platform-th/designer-reference/app-designer/entity/create-new-entity/fields/hidden.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.
