This is Part 1 of a three-part series on Directus fundamentals: Collections (this post), Relationships, and Permissions. New to Directus? Start here.
Introduction
Collections are the bread and butter of the Directus Data Studio. According to Directus's own docs, collections are database tables — with extra metadata and configuration layered on top by Directus.
The part that makes this genuinely beginner-friendly: you never write a single line of SQL. The Data Studio handles all of that for you. Let's build one.
Two Ways to Create a Collection
There are two paths to collection creation inside the Data Studio.
Option 1: Log into your Data Studio and look at the sidebar for the icon that looks like a 3D box — that's Content. Click it, and on the main screen you'll see Create Collection.
Option 2: Scroll down the sidebar to the gear icon — Settings. Click in, and at the top you'll find Data Model. Same deal from there — Create Collection is right on the main screen.
Either path lands you in the same place.
Creating a Collection
- Click Create Collection
- Name it something intuitive — it should describe exactly what data you're storing. For this example, we're creating a collection called products
- Ignore Singleton for now (more on this below)
- In the Type dropdown, select Generated UUID
- Click Next, select all the boxes offered, and click Finish Setup
What is Singleton? You'd only check this if the collection will ever hold exactly one item — not the case here, since we're storing many products.
What is the Generated UUID? A unique ID automatically assigned to every item in the collection, so you never have to manage IDs manually.
Once created, you land on the collection's screen, ready to build its data structure.
Bonus: under Collection Setup, you can customize how the collection looks — a color, an icon, and a short note describing its purpose. Small detail, but it pays off once your Directus project has a dozen collections in it.
Creating Fields Within a Collection
Fields represent the actual data you're storing — in this case, the data that describes a single product. Every item in the collection shares this same structure, just with different values. Here's the full field breakdown for a products collection:
| Field | Type | Notes |
|---|---|---|
name |
Input (string) | The product's name |
brief |
Textarea | Short description — more room than Input, no special formatting needed |
description |
WYSIWYG | Full rich-text formatting — paragraphs, bullet lists, H1–H4 headings |
price |
Input (decimal) | See Precision & Scale below |
sale |
Input (decimal) | Same setup as price
|
isOnSale |
Boolean | Toggle the front end can check to decide which price to show |
category |
Dropdown | Product type — e.g. jersey, pants |
quantity |
Input (integer) | Minimum value of 1 |
image |
File | Product photo |
Setting Up the Price Field (Precision & Scale)
The price field needs a bit of extra configuration. Instead of clicking Save right away, look just below the Save button for Continue in Advanced Field Creation Mode.
In there, you'll find Precision and Scale, defaulting to 10 and 5.
- Precision — the total number of digits the field accepts
- Scale — how many of those digits sit after the decimal point
Left at the defaults, you'd get something like 12345.67890. For a price field, that's overkill — we want 7 digits total, 2 of them after the decimal point. So: Precision = 7, Scale = 2. Adjust to fit your own use case if you need more decimal precision.
Build sale the exact same way.
Note on relational fields: collection relationships (linking one collection to another) are deliberately left out here — that's a big enough topic to earn its own post, and it's exactly what's coming next in this series.
Adding Your Data
Head to the sidebar and click the box icon — Content. You'll see your Products collection listed. Click Create Item, and fill in the fields with real data.
For this example, add a couple of items — a jersey and a pair of jeans — to see the collection actually holding data.
Summary
That's the foundation of Directus collections: the core field types, how to configure them, and how to get real data in. Next up in this series: relationships — how collections connect to each other, which is where Directus really starts to shine.
Questions or stuck on something? Drop a comment below.
Top comments (0)