Importing and mapping collections/fields

I have two questions:

  1. once I manually created a collection with the default fields (ID, status, user_created, etc.) I would like to know if it’s possible to import the remaining fields with a .csv (excel) file. I just want to create the collection’s columns, then I would manage the single settings (schema, interface, etc.) in the Directus dashboard

  2. the day I will have to import my real data, how should I map the fields value to the existing item? For instance, how would I map feat_image to the actual image I have previously uploaded? Just the name of the image would do, or I need to add some URL before?

Or am I getting it all wrong?

1 Like

Hello @Criss,

If you’re importing from an existing Directus project, you can refer to the official schema API documentation here:
:backhand_index_pointing_right: Schema | Directus Docs

If you’re trying to import from another system, you’ll either need to:

Manually create the fields in your new collection, or

Write a small script that creates fields dynamically for each collection using the API.

As for importing data — if you can map your data into a CSV file (matching your Directus fields), you can upload it directly. Otherwise, you’ll need to manually create the items in Directus.

Regarding files: you’ll need to upload them separately to Directus first. Each uploaded file will return an ID, and that’s the value you should use when mapping fields like feat_image. You can’t just use the file name — Directus requires the file ID to properly link it.