
name
, email
, or price
. This page will guide you through creating and configuring entity fields within Amplication.
Create New Fields
Navigate to the Entity Screen
Select an Entity
Add a New Field
Configure Field Details
- Display Name: The user-friendly name shown in the Amplication UI (e.g., “Customer Email”)
- Name: The camelCase name used in code and APIs (e.g.,
customerEmail
) - Description: Optional context about the field’s purpose (e.g., “Primary email address for customer communications”)
Field Settings
Each field offers optional settings to control its behavior and constraints:Unique Field
Unique Field
Toggle Unique Field to ensure that each value in this field is unique across all instances of the entity. This is crucial for fields like email addresses or usernames where duplication isn’t allowed.
Required Field
Required Field
Activate Required Field to make sure that this field must have a value when creating a new entity instance. This prevents incomplete data entries and enforces data integrity for critical attributes.
Searchable
Searchable
Enable Searchable to allow users to search for entity instances based on the values in this field. Note that field visibility for search results is still controlled by permissions settings.
Available Data Types
Select the appropriate data type to define what kind of information your field will store. Each data type is optimized for specific use cases and provides built-in validation and handling.Single Line Text
Multi-Line Text
Username
Password
Whole Number
Decimal Number
Date Time
Boolean
JSON
Option Set
Multi-Select Option Set
Geographic Location
File
Roles
Relation to Entity
Default Fields
Amplication automatically creates essential fields for every entity:id
: A unique identifier for each entity instance. By default, it’s a CUID, but you can customize it to UUID, auto-increment integer, or auto-increment big integer.createdAt
: Automatically tracks the creation timestamp of each entity instance.updatedAt
: Automatically updates with the timestamp whenever an entity instance is modified.
Advanced Customization
For developers who need fine-grained control over their fields, Amplication provides Custom Attributes. These attributes allow you to directly leverage Prisma’s powerful schema customization features within the Amplication UI.@
) to customize individual field properties. These are accessible in the Custom Attributes text field within each field’s settings page.
Common field-level attributes include:
@unique
: Enforce uniqueness for a field@default(...)
: Set a default value@map("column_name")
: Map to a different column name- Native database types: Specify database-specific data types (e.g.,
@db.VarChar(200)
)