What Are Attributes?
When you create a collection and define its attributes, you are describing the shape of every object that will live in that collection. An attribute namedStatus of type Select with options Open, In Progress, and Closed means every object in that collection can have exactly one of those three values for its status — no free-text typos, no ambiguity. Agents use these constraints too: they know the valid values for a select field and will not attempt to write an invalid one.
Supported Attribute Types
Text
Stores any string of characters. Use it for names, descriptions, notes, email addresses, URLs, or any other free-form text. You can configure a maximum length.
Number
Stores integer or decimal numeric values. Useful for quantities, prices, scores, or any measurable value. Supports minimum and maximum range constraints.
Date
Stores a date or date-and-time value in ISO 8601 format. Displayed in your workspace’s configured timezone. Great for deadlines, event timestamps, and expiry dates.
Boolean
Stores a true/false value. Renders as a checkbox in the UI. Use it for simple flags like
Is Active, Requires Review, or Subscribed.Select
Stores one value chosen from a predefined list of options you configure. Prevents invalid entries and makes filtering fast and reliable.
Multi-select
Like Select, but allows an object to hold multiple chosen options simultaneously. Ideal for tags, categories, and labels where several values may apply at once.
Relation
Creates a link between an object in this collection and one or more objects in another collection. Use relations to model real-world associations, such as linking a
Ticket to its Customer.File
Attaches one or more uploaded files to an object. The attribute stores references to files in Layest’s file storage. Agents can read file metadata and contents from these attributes.
Adding and Editing Attributes
To add a new attribute to a collection:1
Open collection settings
Navigate to Data → Collections, open the collection you want to modify, and click the Settings tab.
2
Click Add Attribute
In the Attributes section, click Add Attribute. A configuration panel opens on the right.
3
Name the attribute
Enter a clear, concise name. Attribute names must be unique within a collection. Avoid spaces if you plan to reference the attribute in code — use underscores or camelCase instead.
4
Choose the attribute type
Select one of the eight supported types from the Type dropdown. The configuration options in the panel update to match the selected type.
5
Configure type-specific options
Set any options relevant to the type — for example, add options for a Select attribute, set a max length for Text, or choose the related collection for a Relation attribute.
6
Set required and default value options
Toggle Required on if every object must have a value for this attribute. Optionally set a Default Value that pre-populates the field when a new object is created.
7
Save
Click Save Attribute. The attribute is added to the collection schema immediately. Existing objects will have a blank value for the new attribute until you or an agent populates them.
Required vs. Optional Attributes
Mark an attribute as Required when every object in the collection must always have a value for that field. Layest enforces this constraint at write time — agents and users cannot save an object with a blank required field. Leave an attribute as Optional (the default) when some objects legitimately may not have a value. Optional attributes display a dash in the collection view when no value has been set. Use required attributes sparingly: over-constraining a collection can make bulk imports fragile and cause agent actions to fail when the agent cannot determine an appropriate value.Default Values
A default value is automatically applied to a new object if no explicit value is provided at creation time. Default values are supported on all attribute types:- Text — any string literal, e.g.,
"Unassigned" - Number — any numeric literal, e.g.,
0 - Date — a fixed date or the dynamic value
now(the creation timestamp) - Boolean —
trueorfalse - Select / Multi-select — one of the configured options
- Relation / File — default values are not supported on these types