# Text parameter

Text parameters are replaced by an **array of strings** in your query. They are ideal for filtering data by category names or text-based identifiers—such as product types or admin regions.

## **Text Parameter Settings**

When creating a text parameter, you'll configure:

### **Values**

Define the list of selectable values shown in the control UI.

* **Add manually:** Enter values directly.
* **Add from Source:** Select a column from your data source to auto-populate the list with up to **1,000 distinct values**.
  * You can sort the values by **frequency** or **alphabetically**, in ascending or descending order.

<figure><img src="https://3029946802-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FybPdpmLltPkzGFvz7m8A%2Fuploads%2Fgit-blob-c64527811afb1d2b1d9034be77c57222a96aa13d%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

### **Naming**

* **Display name:** The name that will appear in the control UI.
* **SQL name:** The name that needs to be used in your SQL query. It always has to be enclosed between double curly brackets, like: `{{day_night}}`.

## **Using Text Parameters in your SQL Query**

Once the parameter is created, add the parameer to your SQL query using the SQL name:

```sql
SELECT * FROM `carto-demo-data`.demo_tables.fires_worldwide
WHERE daynight IN {{day_night}}
```

After adding the parameter, the control UI will appear in the **right-side panel**, allowing users to:

* Search values
* Enter custom text
* Select one or multiple categories

{% hint style="info" %}
Text parameters are replaced by an array of strings. Use SQL syntax that supports arrays—like `IN`—for proper evaluation.
{% endhint %}

<figure><img src="https://3029946802-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FybPdpmLltPkzGFvz7m8A%2Fuploads%2Fgit-blob-a8406e930b37e29087077d19f74badae2601656a%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>


---

# 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.carto.com/carto-user-manual/maps/sql-parameters/text-parameter.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.
