> For the complete documentation index, see [llms.txt](https://docs.clickai.vn/clickai-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.clickai.vn/clickai-docs/clickai-docs-en/function/database/fields-data-types-and-configuration.md).

# Fields (Data Types & Configuration)

## Table of Contents

·       \[Introduction to Fields]\(#introduction-to-fields)

·       \[Create a New Field]\(#create-a-new-field)

·       \[Special Fields]\(#special-fields)

·       \[Field Types Reference]\(#field-types-reference)

·       \[Unique Fields]\(#unique-fields)

·       \[Field Actions]\(#field-actions)

&#x20;

## Introduction to Fields

Fields define the structure and type of data stored in each record of a table. They are the building blocks of your database, determining how information is entered, displayed, and processed.

By understanding how fields work, you can design more effective tables and ensure consistent, meaningful data across your workspace.

&#x20;

## Create a New Field

1\.     Click the ➕ icon in the table header where you'd like to insert the new field

2\.     In the New Field panel:

·       Enter the field name

·       Select the appropriate field type (e.g., Single line text, Number, Lookup...)

3\.     Configure additional settings:

·       Default Value: Automatically applied to new records

·       Description: Context and usage guidance for the field

4\.     Click Save Field to finalize

### Default Value

You can set a default value when creating a field. This value is automatically applied to new records created after the field is set (does not affect existing records).

Default values can be:

·       Fixed values: e.g., "N/A", "Unknown", 0

·       Dynamic values: e.g., current date, current time, user ID

### Field Description

Adding a description provides context for team members. The description appears as a tooltip when hovering over the ℹ icon next to the field name in the table header.

&#x20;

## Special Fields

### Primary Key

·       Automatically created when a table is created

·       Uniquely identifies each record

·       Ensures data integrity for backend operations

·       Typically hidden from end users

### Display Value

·       A human-readable label for quick record identification

·       Used when displaying records in the interface (e.g., in Links, Lookup fields)

·       It's recommended to use a field with unique values as the Display Value

📝 NOTE: The Primary Key ensures consistent record management, while the Display Value improves usability and context.

&#x20;

## Field Types Reference

### 📝 Text-based

<table data-header-hidden><thead><tr><th valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Field Type</td><td valign="top">Description</td></tr><tr><td valign="top">Single line text</td><td valign="top">Single line of short text</td></tr><tr><td valign="top">Long text</td><td valign="top">Multi-line text with basic formatting</td></tr><tr><td valign="top">Rich text</td><td valign="top">Rich text with bold, italic, bullets, headings...</td></tr><tr><td valign="top">Email</td><td valign="top">Email address with automatic validation</td></tr><tr><td valign="top">Phone</td><td valign="top">Phone number</td></tr><tr><td valign="top">URL</td><td valign="top">Web link, clickable to open directly</td></tr></tbody></table>

&#x20;

### 🔢 Numerical

<table data-header-hidden><thead><tr><th valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Field Type</td><td valign="top">Description</td></tr><tr><td valign="top">Number</td><td valign="top">Integer values</td></tr><tr><td valign="top">Decimal</td><td valign="top">Decimal/floating-point numbers</td></tr><tr><td valign="top">Percentage</td><td valign="top">Percentage values (displays % symbol)</td></tr><tr><td valign="top">Currency</td><td valign="top">Monetary values (VND, USD, EUR...) with appropriate formatting</td></tr></tbody></table>

&#x20;

### 📅 Date & Time

<table data-header-hidden><thead><tr><th valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Field Type</td><td valign="top">Description</td></tr><tr><td valign="top">Date</td><td valign="top">Date only</td></tr><tr><td valign="top">Time</td><td valign="top">Time only</td></tr><tr><td valign="top">Date and Time</td><td valign="top">Combined date and time</td></tr><tr><td valign="top">Duration</td><td valign="top">Time span (hours, minutes, seconds)</td></tr></tbody></table>

&#x20;

### 🏷️ Select

<table data-header-hidden><thead><tr><th valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Field Type</td><td valign="top">Description</td></tr><tr><td valign="top">Single select</td><td valign="top">Choose one value from a dropdown list</td></tr><tr><td valign="top">Multi select</td><td valign="top">Choose multiple values from a list (tag-style)</td></tr></tbody></table>

&#x20;

### 🔗 Links & Relations

<table data-header-hidden><thead><tr><th valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Field Type</td><td valign="top">Description</td></tr><tr><td valign="top">Links</td><td valign="top">Create relationships between records of two tables</td></tr><tr><td valign="top">Lookup</td><td valign="top">Display a field from a linked table (similar to VLOOKUP in Excel)</td></tr><tr><td valign="top">Rollup</td><td valign="top">Aggregate calculations on linked data (SUM, COUNT, AVG, MIN, MAX)</td></tr></tbody></table>

&#x20;

💡 TIP: \*\*Links\*\* is the most powerful feature of Tables compared to traditional spreadsheets. For example: link a "Customers" table with an "Orders" table to easily view all orders for a customer, or calculate total revenue with Rollup.

### 📎 Custom Types

<table data-header-hidden><thead><tr><th valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Field Type</td><td valign="top">Description</td></tr><tr><td valign="top">Attachment</td><td valign="top">Upload file attachments (images, PDFs, documents...)</td></tr><tr><td valign="top">Checkbox</td><td valign="top">True/false toggle</td></tr><tr><td valign="top">Rating</td><td valign="top">Star rating (1-5 or customizable)</td></tr><tr><td valign="top">Barcode</td><td valign="top">Generate barcode from another field's value</td></tr><tr><td valign="top">QR Code</td><td valign="top">Generate QR code from another field's value</td></tr><tr><td valign="top">JSON</td><td valign="top">Store JSON data</td></tr><tr><td valign="top">Geometry</td><td valign="top">Geometric data</td></tr><tr><td valign="top">GeoData</td><td valign="top">Geographic coordinates (latitude/longitude)</td></tr></tbody></table>

&#x20;

### 🆔 Identifier Types

<table data-header-hidden><thead><tr><th valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Field Type</td><td valign="top">Description</td></tr><tr><td valign="top">UUID</td><td valign="top">Auto-generated unique identifier</td></tr><tr><td valign="top">Auto Number</td><td valign="top">Auto-incrementing number</td></tr></tbody></table>

&#x20;

### 🧮 Formula

<table data-header-hidden><thead><tr><th valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Field Type</td><td valign="top">Description</td></tr><tr><td valign="top">Formula</td><td valign="top">Auto-calculated values based on expressions — supports math, string, date, and logical operations</td></tr></tbody></table>

&#x20;

Formula Examples:\
──────────────\
Total price:     {unit\_price} \* {quantity}\
String concat:   CONCAT({first\_name}, " ", {last\_name})\
Conditional:     IF({status} = "Active", "✅", "❌")\
Date calc:       DATEADD({start\_date}, 30, "days")

&#x20;

## Unique Fields

Certain field types can be configured to enforce uniqueness — preventing two records from having the same value.

### Supported Field Types for Uniqueness

·       Single line text, Email, Phone, URL

·       Number, Decimal, Currency, Percent

·       DateTime, Date, Time

### Important Notes

·       Empty cells are permitted and do not violate the uniqueness constraint

·       When converting an existing field to unique, all existing values must already be unique

·       Unique and Default Value are mutually exclusive

·       Uniqueness constraints are supported only for tables created within ClickAI (not for external databases)

&#x20;

## Field Actions

<table data-header-hidden><thead><tr><th valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Action</td><td valign="top">Description</td></tr><tr><td valign="top">Rename</td><td valign="top">Change the field name</td></tr><tr><td valign="top">Change Type</td><td valign="top">Change the data type</td></tr><tr><td valign="top">Set Default Value</td><td valign="top">Set a default value for new records</td></tr><tr><td valign="top">Adjust Width</td><td valign="top">Adjust the column width</td></tr><tr><td valign="top">Hide/Unhide</td><td valign="top">Show or hide the field in the current view</td></tr><tr><td valign="top">Set as Display Value</td><td valign="top">Set as the primary display label</td></tr><tr><td valign="top">Sort</td><td valign="top">Sort ascending or descending by this field</td></tr><tr><td valign="top">Duplicate</td><td valign="top">Create a copy of the field</td></tr><tr><td valign="top">Insert Before/After</td><td valign="top">Insert a new field before or after</td></tr><tr><td valign="top">Delete</td><td valign="top">Remove the field</td></tr><tr><td valign="top">Add Description</td><td valign="top">Add or edit the field description</td></tr></tbody></table>

&#x20;

How to access: Right-click on the field header or click the ▼ icon in the header to open the context menu.

🚨 WARNING: When changing a field type (Change Type), existing data will be automatically converted. However, some conversions may cause data loss (e.g., converting Rich Text to Number). Always review before making changes.


---

# 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:

```
GET https://docs.clickai.vn/clickai-docs/clickai-docs-en/function/database/fields-data-types-and-configuration.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.
