> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xano.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Inputs

> Data that is supplied to the logic before execution

Inputs are the data that is supplied to the primitive *outside of Xano* that it needs to run. For example, an API used to log in would probably need an email and a password.

There are several different types of inputs you can use to handle any data type. You can also make inputs optional, required, lists, or apply filters to transform them or require them to meet certain criteria.

### Adding an Input

> [tab] Visually: Canvas View
>
> **1. Click Add an Input**
>
> ![apis-20251013-103714](https://mintcdn.com/xano-997cb9ee/_YwYe_syRaE7iZGt/images/apis-20251013-103714.png?fit=max\&auto=format\&n=_YwYe_syRaE7iZGt\&q=85\&s=9be1c801b5c70e2272265b342f158b59)
>
> **2. Select the type of input you want to add.**
>
> ![apis-20251013-103749](https://mintcdn.com/xano-997cb9ee/_YwYe_syRaE7iZGt/images/apis-20251013-103749.png?fit=max\&auto=format\&n=_YwYe_syRaE7iZGt\&q=85\&s=2d3ae035fa65417a2f1218be9d3035a2)

> [tab] Visually: Function Stack
>
> **1. Click Add an Input**
>
> ![inputs-20251013-105146](https://mintcdn.com/xano-997cb9ee/NgWyYUIOE6OPGYha/images/inputs-20251013-105146.png?fit=max\&auto=format\&n=NgWyYUIOE6OPGYha\&q=85\&s=4a81cfc50ad2023829f3b5b6252e00a2)
>
> **2. Select the type of input you want to add.**
>
> ![inputs-20251013-105219](https://mintcdn.com/xano-997cb9ee/NgWyYUIOE6OPGYha/images/inputs-20251013-105219.png?fit=max\&auto=format\&n=NgWyYUIOE6OPGYha\&q=85\&s=af6c33c0de68fbd642adf1d8c86e4d09)

> [tab] XanoScript
>
> Inputs are defined in the `input` block, placed immediately after the declaration and accompanying parameters, such as the description.
>
> ```javascript lines icon="code" Example of the input block and positioning theme={null}
> query user_list verb=GET {
>     description = "Query all user records"
>     input {
>         text name? filters=trim
>         }
>   ...
> }   
> ```

Each input will have a different set of options depending on the input type chosen. Keep reading to see more information about all of the available input types and available options.

### Input Options

| Option | Explanation | Example |
| - | - | - |
| Description | A short, human-readable summary of the input. | For an `email` field: “The user’s email address.” |
| Data structure | Single value or list of values. | Set to `list` to allow multiple values. |
| Allow nullable values | Whether the input can be `null`. | Set to `true` to allow `null`. |
| Default value | Value used if input isn’t provided. | Useful for optional fields that still need a stored value. |
| Required | Whether the input must be provided. | Set to `true` to make the field mandatory. |
| Sensitive data | Whether the field contains sensitive info. | Set to `true` to hide it from request history. |
| Custom rules and filters | Filters and validation applied to the input. | e.g. `trim` to remove whitespace. |

## Filters and Rules

> [tab] Visually
>
> With your input selected, scroll down to the Custom Rules and Filters section, and choose **+ Add an Input Rule**.
>
> ![inputs-20251013-124949](https://mintcdn.com/xano-997cb9ee/NgWyYUIOE6OPGYha/images/inputs-20251013-124949.png?fit=max\&auto=format\&n=NgWyYUIOE6OPGYha\&q=85\&s=d3cbfbe25703a52724c5e4f930bc8be4)

> [tab] XanoScript
>
> Filters and rules are defined in the input block, placed immediately after the input type.
>
> ```javascript lines icon="code" Example of filters and rules in XanoScript theme={null}
> text name? filters=trim|lower
> text name? min:8|minAlpha:1|minDigit:1
> ```

### Input Filters

Transform the data sent to the input on the fly.

| Filter | Explanation | Example |
| - | - | - |
| `trim` | Trims whitespace from the input. | `‎ ‎ hello‎ ‎ ` becomes `hello`  ![core-components-20251010-120859](https://mintcdn.com/xano-997cb9ee/cecR9MdyjjLVeP7i/images/core-components-20251010-120859.png?fit=max\&auto=format\&n=cecR9MdyjjLVeP7i\&q=85\&s=08c4393e46442410c4ad6535e3a6aa1e) |
| `lower` | Converts the input to lowercase. | `HELLO` becomes `hello` ![core-components-20251010-120935](https://mintcdn.com/xano-997cb9ee/cecR9MdyjjLVeP7i/images/core-components-20251010-120935.png?fit=max\&auto=format\&n=cecR9MdyjjLVeP7i\&q=85\&s=a9b74b7fd41cd6101ebefedbbfb033ce) |
| `upper` | Converts the input to uppercase. | `hello` becomes `HELLO` ![core-components-20251010-120954](https://mintcdn.com/xano-997cb9ee/cecR9MdyjjLVeP7i/images/core-components-20251010-120954.png?fit=max\&auto=format\&n=cecR9MdyjjLVeP7i\&q=85\&s=d17227b28bf20020b59a04ba2931f16f) |

### Input Rules

Validate the data sent to the input. If the data doesn't meet the criteria, the logic will fail to execute.

| Rule | Explanation | Example |
| - | - | - |
| `min` | Requires a minimum length. | `Hello` is not valid, but `Hello World` is.  ![core-components-20251010-121029](https://mintcdn.com/xano-997cb9ee/cecR9MdyjjLVeP7i/images/core-components-20251010-121029.png?fit=max\&auto=format\&n=cecR9MdyjjLVeP7i\&q=85\&s=78a2ab21299bc69028dee352437b155e) |
| `max` | Requires a maximum length. | `Hello World` is not valid, but `Hello` is.  ![core-components-20251010-121049](https://mintcdn.com/xano-997cb9ee/cecR9MdyjjLVeP7i/images/core-components-20251010-121049.png?fit=max\&auto=format\&n=cecR9MdyjjLVeP7i\&q=85\&s=80677d9e9c208a168b4c6a570abf40b4) |
| `startsWith` | Requires a prefix. | If set to `invoice-`, `invoice-abc123` is valid, but `abc123` is not.  ![core-components-20251010-121215](https://mintcdn.com/xano-997cb9ee/cecR9MdyjjLVeP7i/images/core-components-20251010-121215.png?fit=max\&auto=format\&n=cecR9MdyjjLVeP7i\&q=85\&s=40a7ac43b9a077c13067fbf1ce01c737) |
| `prevent` | Prevents a phrase. | If set to `hello`, `hello world` is not valid, but `goodbye world` is.  ![core-components-20251010-121300](https://mintcdn.com/xano-997cb9ee/cecR9MdyjjLVeP7i/images/core-components-20251010-121300.png?fit=max\&auto=format\&n=cecR9MdyjjLVeP7i\&q=85\&s=dc86585de64984d2c254495af1a0272e) |
| `alphaOk` | Allows alphabetic characters only. | `hello` is valid, but `hello123` is not.  ![core-components-20251010-121318](https://mintcdn.com/xano-997cb9ee/cecR9MdyjjLVeP7i/images/core-components-20251010-121318.png?fit=max\&auto=format\&n=cecR9MdyjjLVeP7i\&q=85\&s=716cd05c172a687824317620acff37b1) |
| `digitOk` | Allows numerical characters only. | `hello` is not valid, but `123` is.  ![core-components-20251010-121334](https://mintcdn.com/xano-997cb9ee/cecR9MdyjjLVeP7i/images/core-components-20251010-121334.png?fit=max\&auto=format\&n=cecR9MdyjjLVeP7i\&q=85\&s=aa26156d29d632eae381bff437a3e781) |
| `ok` | Allows only specific characters. | If set to `abc123`, `hello` is not valid, but `abc123` is. `abc` is valid, but `cde` is not.  ![core-components-20251010-121357](https://mintcdn.com/xano-997cb9ee/cecR9MdyjjLVeP7i/images/core-components-20251010-121357.png?fit=max\&auto=format\&n=cecR9MdyjjLVeP7i\&q=85\&s=f7e6f86edd25e859f50d920a47d496a5) |

## Input Reference

Review all available input types below by selecting the section you're interested in.

> [card] Text
>
> A plain string of text, code, or any other characters.

> [card] Integer
>
> A whole number, such as a count, year, or ID.

> [card] UUID
>
> A *Universally Unique Identifier* — a random string used to ensure record uniqueness.

> [card] Object
>
> A JSON object with a defined schema (e.g., user settings or product details).\\
>
> ```json lines icon="code" Example of an object input theme={null}
> {
>     "name": "John Doe",
>     "age": 30,
>     "email": "john.doe@example.com"
> }
> ```

> [card] Table Reference
>
> An integer or UUID referencing a record in another table.

> [card] Vector
>
> A fixed-length array of numbers (embedding) for similarity search in AI/ML.

> [card] Enum
>
> A predefined list of values to enforce consistency (e.g., "To Do", "In Progress", "Done", "Pending").

> [card] Timestamp
>
> A point in time in milliseconds since the Unix Epoch (Jan 1, 1970).

> [card] Date
>
> A calendar date in `YYYY-MM-DD` format.

> [card] Boolean
>
> A true or false value.

> [card] Decimal
>
> A number with a decimal point (e.g., 1.5, 100.00, 0.001).

> [card] Email
>
> An email address.

> [card] Password
>
> A hashed and salted password. Plain text is never stored or retrievable.

> [card] JSON
>
> A flexible JSON object or array without a defined schema — ideal for variable data (e.g., from external APIs).
>
> ```json lines icon="code" Example of a JSON input theme={null}
> {
>     "name": "John Doe",
>     "age": 30,
>     "email": "john.doe@example.com"
> }
> ```

> [card] Storage
>
> File metadata for images, videos, audio, or other files (e.g., URL, name, size, type). Actual files are not stored in the database.

> [card] Geography
>
> Stores geographic data such as a point, path, or polygon.


## Related topics

- [Input types](https://docs.xano.com/xanoscript/input-types-reference.md)
- [XanoScript Key Concepts](https://docs.xano.com/xanoscript/key-concepts.md)
- [Expression](https://docs.xano.com/the-function-stack/data-types/expression.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.