# 自定义资料与用户输入

在信息区块显示自订资料&#x20;

如果你想设置自订资料并在讯息中显示该值，你可以在讯息区块输入 {{customFields.fieldvalue}} 。如果你想自订一项名为 "membership" 的资料，并以 "diamond" 为值，那么你可以输入 {{customFields.membership}}。当用户触发到这个流程，他就会在讯息中见到 "diamond" 这个值。

{% hint style="info" %}
输入 {{customFields.fieldvalue}} 以显示该联络人的自订资料值。
{% endhint %}

<figure><img src="https://3178083785-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FP7nf2G1iCRba8EP7DawZ%2Fuploads%2F5ElVAY77edrp2quhGBZX%2F%E8%9E%A2%E5%B9%95%E6%88%AA%E5%9C%96%202022-12-19%20%E4%B8%8B%E5%8D%883.00.14.png?alt=media&#x26;token=bf7a660e-88e9-40c3-904a-ee5633dcf253" alt=""><figcaption><p>此示例为一项连带按钮选项的文字讯息，点击按钮后会设置自定资料，并显示该自订资料的值。</p></figcaption></figure>

​

<figure><img src="https://3178083785-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FP7nf2G1iCRba8EP7DawZ%2Fuploads%2FNSIvrp6LHxePHI4fU0ou%2FScreenshot_20221219_145721.jpg?alt=media&#x26;token=4e652169-1139-43d5-affd-7a4e6bd2095e" alt=""><figcaption><p>這是從上述流程中點擊 "Moisturizers" 選項時的實際結果。</p></figcaption></figure>

在讯息区块显示用户输入变数&#x20;

如果你已经设置好用户输入区块，你应该已经设置了储存用户输入的变数。当变数已存在任何值，你便可以在讯息区块输入大括号及该变数名称，例如 {{age}}。将变数放在讯息区块中可以使你的对话更加灵活。

{% hint style="info" %}
输入 {{userinputvariable}} 以显示该联络人的用户输入的变数。
{% endhint %}

<figure><img src="https://3178083785-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FP7nf2G1iCRba8EP7DawZ%2Fuploads%2FfiRFobhQqG4m494z9nHB%2F%E8%9E%A2%E5%B9%95%E6%88%AA%E5%9C%96%202022-12-19%20%E4%B8%8B%E5%8D%883.10.42.png?alt=media&#x26;token=9c075864-2b5e-44a1-84d9-e74a326e3101" alt=""><figcaption><p>此示例为用户输入区块，其中包含确认年龄是否超过18岁的条件漏斗。如果未满 18 岁，该讯息将显示其实际年龄并说明无法继续进行下一步。</p></figcaption></figure>

<figure><img src="https://3178083785-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FP7nf2G1iCRba8EP7DawZ%2Fuploads%2F4wlEOFdGJ0gxjok9kZQ1%2FScreenshot_20221219_151320.jpg?alt=media&#x26;token=b8d3d51a-932d-41ed-a547-735e27137425" alt=""><figcaption><p>這是在回覆 “17”（數值低於18）時，按上述流程返回的實際結果。</p></figcaption></figure>

把用户输入变数储存到自订资料&#x20;

在更复杂的情况下，你或需要收集用户输入的值，同时把该值储存到自订资料中。你需要做的是在用户输入区块后连接一个自订资料区块。然后你需要把用户输入变数作为自订资料的值。例如，如果你把用户输入变数命名为 "age"，你应该在自订资料的值上输入 {{age}} 。

<figure><img src="https://3178083785-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FP7nf2G1iCRba8EP7DawZ%2Fuploads%2FCuEhbUf0G84Bn1hJV3BT%2F%E8%9E%A2%E5%B9%95%E6%88%AA%E5%9C%96%202022-12-19%20%E4%B8%8B%E5%8D%883.29.27.png?alt=media&#x26;token=c4449a20-b7ab-4af0-9e59-38f61e6187a5" alt=""><figcaption><p>此示例為用戶輸入變數儲存到自訂資料中。</p></figcaption></figure>

<figure><img src="https://3178083785-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FP7nf2G1iCRba8EP7DawZ%2Fuploads%2FUfXxZnbgyfExDHwEredR%2FScreenshot_20221219_154008.jpg?alt=media&#x26;token=fd98d140-eadc-4d8a-b1f7-695018e731e4" alt=""><figcaption><p>這是在回覆 “16”（數值低於18）時，按上述流程返回的實際結果。</p></figcaption></figure>

以上示例是上一个流程的复杂版本。不同之处在于用户输入和条件漏斗之间加插了一个自订资料区块。用户输入变数储存到名为 "age" 的栏位的值。最后的讯息区块也修改成 {{customFields.age}}。&#x20;

实际显示的讯息与上一个流程相同，但用户输入变数储存在自订资料中，以实现其他目的，例如保留对话历史记录、根据自订资料来筛选联络人、汇出带有自订资料的联络人等。

{% hint style="info" %}
由于用户输入变数 {{age}} 储存到名为"age"的自订资料中。因此，无论你输入的是用户输入变数 {{age}} 还是自订资料 {{customFields.age}}，你都同样可以获得同样的结果。
{% endhint %}

{% embed url="<https://youtu.be/G0yEZHugTL0>" %}


---

# 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.chatalog.ai/zh-cn/crm-quickstarts/customized-flow/custom-field-and-user-input-setup-in-flow.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.
