# Validar celular

Para essa validação são aplicadas algumas regras de expressão regular.

```javascript
[
    {
        "name": "validate_cellphone",
        "parameters": {
            "phone": "<? input.text ?>"
        },
        "result_variable": "cellphone_validation"
    }
]
```

## Atributos

* **name:** validate\_cellphone
* **parameters:**
  * **phone:** número de celular que será validado.
* **result\_variable:** variável de contexto que receberá o resultado da validação. Em caso de sucesso, essa variável conterá o seguinte JSON:

  ```javascript
  {
    "valid": true,
    "phone": "<número de telefone pós-validação>"
  }
  ```

## Exemplo

```javascript
[
    {
        "name": "validate_cellphone",
        "parameters": {
            "phone": "(35) 98877 6655"
        },
        "result_variable": "cellphone_validation"
    }
]
```

No exemplo acima, está apresentado um possível dado que o usuário poderia digitar. Esse dado passa por uma validação com uso de regex e, se for aprovado, será retornado o seguinte JSON:

```javascript
{
    "valid": true,
    "phone": "35988776655"
}
```


---

# 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.altu.d1.cx/build/assistentes/builder/componentes/actions/validate_cellphone.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.
