> For the complete documentation index, see [llms.txt](https://tailieu.appon.vn/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tailieu.appon.vn/huong-dan-co-ban/su-dung-action/chuc-nang-condition-dieu-kien.md).

# Sử dụng Điều kiện(Condition)

Tính năng **Điều kiện** giúp bạn "Ẩn" hoặc "Hiện" 1 Block. Tính năng này thực hiện theo điều kiện theo toán tử hoặc giá trị dữ liệu : lớn hơn, nhỏ hơn, bằng giá trị,khác giá trị, nhỏ hơn hoặc bằng và lớn hơn hoặc bằng.

Mình sẽ lấy ví dụ như sau: Khi khách hàng nhập vào họ và tên thì mình mới hiện thị ra 1 đoạn văn bản lời chào, còn nếu khách hàng chưa nhập vào tên thì mình sẽ không hiển thị đoạn văn bản đó.

* Để làm được ví dụ này các bạn cần tạo 1 **Model(Dữ liệu)** để lưu trữ thông tin khách hàng nhập và dùng nó để check **Điều kiện.**&#x20;
* Sau đó kéo một **Block Text** và một **Block Input** ra giao diện chỉnh sửa.&#x20;
* Tại **Block Input** chúng ta chọn gán dữ liệu cho **Model** vừa tạo còn đối với **Block Text** chúng ta cũng sẽ chọn **Model** dữ liệu đó để hiển thị nội dung đã điền trong **Input** kèm thêm lời chào và đặt điều kiện hiển thị.

![Tạo Model để lưu dữ liệu và đặt điều kiện](/files/e5cDWqz59hYUwpl0WJ5Z)

![Gán giá trị cho model ở Block Input](/files/PgcxHK1fJMkcfZmioCrc)

![Hiển thị giá trị của Model ở Block Text và đặt điều kiện hiển thị](/files/szB1o6W5xJ7sgePhmMf9)

Tại điều kiện hiện thị mình đang để giá trị của **Model "**&#x48;ovaTen" bằng với "Nguyen" thì mới hiển thị **Block Text,** các bạn cũng có thể thử với các giá trị khác. Sau khi làm xong các bước trên, bạn hãy **Publish(xuất bản)** ứng dụng và kiểm tra thành quả mình vừa làm được.

![Khi chưa điền giá trị](/files/qJsxO5l2WHAd2F6sV74v) ![Sau khi điền giá trị](/files/ZVKNNZGv4wI62ajrCjqg)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://tailieu.appon.vn/huong-dan-co-ban/su-dung-action/chuc-nang-condition-dieu-kien.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
