Field Types

Xano supports a number of different field types to be used in the building of your database.

While Xano's table editor might appear like a standard spreadsheet, it can store rich content in each cell. For example, a table can contain records (rows) with attachments, files, checkboxes, location data, links to records in other tables, and much more.

The data type is for the Database to understand what type of data is expected inside of each column, and it's always a way to ensure data is stored in a consistent and known format.

Below are all of the supported Field Types in Xano:

Text variable-length character string. Typically used for things like titles, names, descriptions and urls

Text fields can have certain formatting applied to them, depending on the type of content you are working with. The following options are available:

  • Plain Text

  • HTML

  • YAML

  • XML

  • Markdown

Integer: A number without decimals. Used to store whole numbers like age or a credit card number

Object: An object is a collection of properties or key values. Here's a great example of what an object is. If the object was a car, it's properties might be brand, weight, color, make, year

There is no hard and fast rule on this, but we like to say if you anticipate your object list growing over 100, it's probably time to start thinking about separating it into a new table. You can still keep everything in an object, but it becomes a little unwieldy to manage especially because when you update objects, you're updating the whole thing (so potentially 100+ records) and if you make a mistake on how you update the data on the front-end, it could lead to some trouble.

Table Reference: this is what is used to define Table relationships. It's an integer that references another table using the id . Used to tell Xano when one piece of content is related to another. Enum: A list of possible values. This is typically used when you're doing a list like roles (basic, admin, super admin). Timestamp: A timestamp is stored as a Unix timestamp in milliseconds. Anytime you store a date or time, you would use this field type.

Date: Store dates with an easy calendar interface.

Boolean: logical Boolean When you want to store a true/false checkbox

Decimal: You can store a decimal value with 31072 digits before the decimal point to 16383 digits after the decimal point. Good for when you want to display fractional values

Email: Storing an email address email address format: example@xano.com.

Password: this is a special case where the data entered into this field is automatically encrypted using salt encryption. You can also configure how passwords are stored. Use to store passwords or anything sensitive

  • Image Metadata: this allows you to upload any image files. For example: .jpg.

  • Video Metadata: this allows you to upload any video files. For example: .mp4.

  • Attachment Metadata: this allows you to upload any files with the exception of .exe.

JSON: Consists of 6 data types. First four data types (string, number, boolean and null) can be referred as simple data types. Other two data types (object and array) can be referred as complex data types. Here's a great article if you want to learn more. Typically used when you are storing temporary data. a good example is user-generated data such as filling out a form or data logging.

Storage: Upload a file to Xano.

Timestamp: this is the number of milliseconds that have elapsed since the Unix epoch. Learn more about Date & Time in Xano

Vectors: Special vector embeddings for machine language and AI tools

Xano supports array (list) structures for each of field types available in the database.

Adding a database field

Click the + sign to add a new field.

In the panel that opens, you have several options to select from. Choose the field type you'd like to create to proceed to the next step, which will allow you to define the parameters applicible to that data type.

  1. Give your input a name (required)

  2. Describe the purpose of the field

  3. Choose whether this field is a single value, or contains a list of values

  4. Allow 'null' values to be applied to this field

  5. Format allows you to choose text formatting, such as JSON, HTML, and more.

  6. Default Value gives the option to specify a default value to fill in as new records are created (if another value is not provided at that time)

  7. Required setting enables checking to ensure that a value must be provided to write records to the table via an API. Sensitive Data enables hiding submitted values to this field in your API request history.

  8. Column visibility enables you to dictate the availability of this field to your function stacks

  9. Add filters that will auto-apply to this value when it is added to the database, such as trimming whitespace.

  10. Save your changes

API Access on field types

This feature allows you to further enforce restrictions when it comes to how your Database Fields are displayed using the API. For example, you might want to change the API access level of any fields containing particularly sensitive information, such as passwords.

  • Public - This field is accessible to be used in any API.

  • Private - When you create a CRUD API endpoint that references this table, This field will be hidden from the Input section of the NO CODE API builder.

  • Internal - When you create a CRUD API endpoint that references this table, This field will be hidden from the Input section of the NO CODE API builder AND from the response of any Database Function that accesses it.

This setting does not impact data returned when using the Metadata API.

Sensitive Data Flag

This option allows you to mark any database field as 'sensitive data', which will automatically hide those pieces of data in your request history. Similar to a password field, if you are working with a field that contains sensitive data in your function stack, it will be returned as ***HIDDEN*** instead of the actual data.

  • Point (geo_point): a special type that represents a point on the map using latitude and longitude.

  • Point Collection (geo_multipoint): a special type that represents a collection of points on one map using latitude and longitude.

  • Path (geo_linestring): a collection of points that represent a line on a map using the latitude and longitude of each point.

  • Path Collection (geo_multilinestring): a collection of lines on one map.

  • Polygon (geo_polygon): a collection of lines that form a multi-sided shape on a map.

  • Polygon Collection (geo_multipolygon): a collection of polygons on one map.

Last updated