> 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/data-transformation/format-phone.md).

# Format Phone

### Overview

The **Phone Formatting Component** (identified in the system by the technical identifier `format_phone`) is a utility node focused on data processing and sanitization (*data sanitization*). Its main function is to capture raw or fragmented strings of phone numbers collected throughout the flow and unify them under international syntax and standardization guidelines. It ensures that the contact record is saved correctly in the database, avoiding communication failures in future outbound messages.

### Configuration Parameters

The block parameterization manages the input strings and output variable mapping in the system:

* **DDI:** Text input field intended to receive the country’s International Direct Dialing code for the contact (e.g.: `55` for Brazil). Accepts static values or dynamic flow variable tags.<br>
* **Phone:** Input field that receives the body of the phone number (with or without the regional area code). It is the raw data that will go through the cleaning and concatenation process.<br>
* **New Key:** Text field used to define the name of the container or local variable (the visual default displayed is `formatedPhone`) that will be generated by the platform to store and expose the fully processed and unified number to the rest of the flow.<br>

### Visual Builder

The builder interface adopts a lean, linear model focused on structured input collection:

* **Separate Inputs Form:** The builder visually divides the country properties (*DDI*) and line (*Phone*), allowing the administrator to structure flexible rules in flows that serve leads of different nationalities.<br>
* **Automated Output Indexing:** The field *New Key* is natively pre-filled to speed up flow design. In the automation editor, the block has traditional input and output connectors, processing the string and releasing the contact for the next step in microseconds.<br>

### Special Operators

The logical properties of this component manage concatenation routines, removal of special characters, and payload injection:

* **Advanced String Sanitization (Data Cleaning):** The component’s internal engine applies native regular expressions to automatically remove any non-numeric characters entered in the input fields, eliminating spaces, parentheses, periods, hyphens, or plus symbols (`+`).<br>
* **Scope Concatenation and Interpolation:** The fields *DDI* and *Phone* accept the insertion of dynamic data in double-brace format `{{...}}`. At execution time, the engine resolves the variables (e.g. by fetching `{{ddi_capturado}}` and `{{resposta_telefone}}`), joins the numeric blocks linearly and injects the final cleaned string into the variable specified in *New Key*.<br>

### Practical Examples

The table below demonstrates classic application scenarios for this component to standardize phone data on the platform:

| **Provided DDI**  | **Provided Phone Number (Raw)** | **Configured New Key** | **String Returned in Variable** | **Practical Use Case**                                                                                                                                          |
| ----------------- | ------------------------------- | ---------------------- | ------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `55`              | `(61) 99999-9999`               | `formatedPhone`        | `5561999999999`                 | The user typed the phone number with parentheses and hyphens in Webchat. The component cleans the symbols and generates the number ready for official channels. |
| `{{contato.ddi}}` | `61992222222`                   | `telefoneValido`       | `5561992222222`                 | Reuse the contact profile DDI and concatenate it with the raw number typed in a Facebook Messenger screening step.                                              |
| `55`              | `{{$data.input_fixo}}`          | `whatsappDestino`      | `5511988887777`                 | Capture a number coming from an external form via API, reformat it entirely, and use it as a parameter in the HSM sending block.                                |


---

# 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/data-transformation/format-phone.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.
