> For the complete documentation index, see [llms.txt](https://docs.hablla.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hablla.com/hablla-docs-en/automation-flows/all-components/facebook-components/facebook-question.md).

# Facebook Question

### Overview

The **Facebook Messenger Question Component** is an action node focused on screening, structured data collection, and enrichment of records on the platform. Its main function is to send a statement or question directly to the user's private chat (DM) on Facebook Messenger and wait synchronously for a typed response. The automation keeps the contact at this stage until a compatible piece of data is provided, allowing the input to be saved and the conversation flow to continue.

### Configuration Parameters

The component's configuration manages the user's input validation rules and the destination for storing the collected data:

* **Type:** Fixed and restricted field of the component in this channel. It supports only the `Text`, establishing that all questions sent by this block wait exclusively for text-typed responses from the end user (without support for interactive button menus or native API lists).<br>
* **Message (\* Required Field):** The question statement or instruction that the chatbot will send in the customer's dialog box.<br>
* **Has Variable (Toggle Key - Toggle Switch):** When enabled, it allows saving the typed input in a memory container, operating through static keys (*Fixed*) or dynamic keys (*Expression*).<br>
* **Variable (\* Required if active):** The name of the tag or local variable (e.g.: `response`) created to temporarily store the response content.<br>
* **Response Target:** Dropdown menu to map and permanently save the data in the contact profile properties. The options cover native and custom fields such as: `Name`, `Phone`, `Email`, `Address`, `CPF`, `CNPJ`, `Date`, `NPS`, `CSAT` or a `custom_field`.<br>
* **Skip if the goal is met (Toggle Switch):** If the contact already has valid data in the selected field in *Response Target*, the component silently skips this step in the flow to avoid redundant questions.<br>
* **Accept response&#x20;*****(*****&#x20;Required Field):** Data validator filter that determines the acceptable syntax for moving the flow forward. The search menu offers the following validation formats:
  * *Text/Number Structures:* `Text`, `Number`, `Valid Data`.<br>
  * *Registration Fields:* `Phone number`, `Email`, `CPF`, `CNPJ`, `Date`.<br>
  * *Search and Location:* `NPS`, `CSAT`, `Location`.<br>
  * *Media Formats:* `Audio`, `Document`, `Video`, `Image`, `Contact`.<br>

### Visual Builder

The graphical interface focuses on strict form validation and linear process control in the automation tree:

* **Required Saving Fields:** Unlike informational nodes, the requirement marked by asterisk (`*`) in the fields of *Message* and *Accept response* prevents conversation rules from being published with validation gaps, avoiding trapping the user in a question without exit criteria.<br>
* **Sequential Flow Node with Validation:** In the design editor, the component displays a traditional output port. However, the automation engine creates an invisible logical repetition loop: if the client provides a response that fails the selected criterion in *Accept response*, the block repeats the original message continuously until it receives a compatible input.<br>

### Special Operators

The logical properties of this component deal with data mask engines and syntactic validation (*input validation*) for social chat channels:

* **Document and Data Validation Masks:** When the field *Accept response* is configured for specific keys (such as `CPF`, `CNPJ` or `Email`), the internal engine applies checking algorithms to the string typed by the user. Inputs that do not match the mathematical structure of a valid CPF or the standard email syntax are automatically rejected at the API receiving layer.<br>
* **Pre-Mapping of Global Variables:** The field *Message* is compatible with string interpreters through double braces (`{{...}}`). This makes it possible for the question sent in Messenger to use data captured in other channels or blocks (e.g.: "`{{name}}`, please confirm your CPF for us:").<br>

### Practical Examples

The table below demonstrates use cases of the component to perform registrations and smart screenings through Facebook Messenger:

| **Selected Type** | **Configured Message**                                       | **Response Target / Variable**                                                                                      | **Accept response** | **Practical Use Case**                                                                                                                    |
| ----------------- | ------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------- | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| `Text`            | "What is your CPF number?"                                   | <p><strong>Target:</strong> <code>CPF</code><br><br><br><br><strong>Variable:</strong> <code>cpf\_client</code></p> | `CPF`               | Capture and validate the user's document. If they type letters or incomplete numbers, the system rejects it and shows the question again. |
| `Text`            | "Please enter your date of birth (DD/MM/YYYY):"              | <p><strong>Target:</strong> <code>Date</code><br><br><br><br><strong>Variable:</strong> <code>birth</code></p>      | `Date`              | Collect chronological data to update the contact profile and save it in the platform's CRM registration record.                           |
| `Text`            | "From 0 to 10, how likely are you to recommend our service?" | <p><strong>Target:</strong> <code>NPS</code><br><br><br><br><strong>Variable:</strong> <code>nps\_score</code></p>  | `NPS`               | Run a direct text-based transactional satisfaction survey in the Facebook DM at the end of a support journey.                             |


---

# 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.hablla.com/hablla-docs-en/automation-flows/all-components/facebook-components/facebook-question.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.
