> For the complete documentation index, see [llms.txt](https://docs.dmflow.chat/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.dmflow.chat/domain/formqa/form.md).

# 表單

## 表單組件

當點選新增、修改時，會跳出的組件排版，組件的設計由上而下，因為只要更新組件同時組件也是對話時收集詞槽的標準。

### 組件內容

| 組件         | 描述                                                                                                                                  |
| ---------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| Text Field | 文字(\<input>)                                                                                                                        |
| Tags       | 標籤，可儲存多個內容在一個欄位。                                                                                                                    |
| Textarea   | 顯示為Markdown                                                                                                                         |
| Checkbox   | 數值適合true/false                                                                                                                      |
| Radio      | 數值適合單選                                                                                                                              |
| DateTime   | 可選取日期及時間                                                                                                                            |
| Date       | 可選取日期                                                                                                                               |
| Select     | 可多選/單選，Select可以整合其他表單的欄位，也可以監聽其他select數值做變動，需要注意的是被監聽的select需要在監聽的select下方，例如: 第一個select可以選擇縣市，第二個select可以選擇鎮，順序不能顛倒，否則使用聊天對話可能會出錯。 |
| Email      | 會幫你驗證是否為Email，你也可以用Text Field做正則表示法，目的相同。                                                                                           |
| Upload     | 檔案上傳，**檔案上傳目前不支援對話**，只能支援一般表單填寫。建議使用關鍵字。                                                                                            |
| Number     | 會幫你檢證是否為數字，你也可以用Text Field做正則表示法，目的相同。                                                                                              |
| Password   | 可以用Utils的加密及比對                                                                                                                      |
| Hidden     | 可以佔欄位數值，分為常數(固定數值)、頁面(可以根據連結欄位取得開啟連結欄位的數值)、會話(目前僅支援userId)                                                                          |
| Reserve    | 預約，欄位同時包含關鍵字、開始時間、結束時間。但開始時間以及結束時間必須在同一天，目前不支援不同天。                                                                                  |
| Paragraph  | 段落，在對話系統會當作文字訊息輸出。                                                                                                                  |

### 表單呈現

<figure><img src="/files/XZCWn6UXBPYQddLDaRFt" alt="" width="375"><figcaption><p>此為新增表單</p></figcaption></figure>

### 表單權限

目前分別為訪客以及使用者

權限分為: 新增、讀取、更新、刪除以及只能是創建使用者的讀取、更新以及刪除。

* 訪客: 訪客大多為來自LINE、Messenger、IG或是Telegram的使用者，他們可以通過對話新增資料，可以看到訪客開的權限，通常是開新增和使用者讀取。
* 使用者: 在LINE、Messenger、IG或是Telegram使用連結到DMflow帳號者可以使用。

### 表單功能

建立好新的表單後，同時會更新對話機器人運行新增表單的方式。

* Required 為 必填項目
* Options 為 必須滿足裡面的數值
* 時間、數字最大以及最小值、文字正則表示法


---

# 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://docs.dmflow.chat/domain/formqa/form.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.
