Spreadsheet Import
Import content types and their fields from an XLSX spreadsheet. Strata parses, validates, and lets you selectively choose which content types to import — with automatic registry resolution and dependency detection.
How it works
The spreadsheet import follows a two-phase flow:
- Preview — upload your XLSX file and Strata parses it, validates every content type and field, and shows you exactly what will be created along with any errors.
- Import — select which content types to import (or import all) and confirm. Strata creates the entries within a database transaction, tracks them in the changeset, and resolves all registry references.
Download the template
Strata provides a downloadable XLSX template tailored to your project's registry. The template includes:
Example sheet (“Article”)
A pre-filled worksheet showing the expected format with four example fields: Body (text_with_summary), Image (image), Tags (entity_reference), and Published Date (datetime). Each row demonstrates the correct column format.
Reference sheet
A lookup sheet generated from your project's registry containing:
- Field Types — all available field types with machine names and labels
- Widgets — all widgets with their compatible field types listed
- Formatters — all formatters with their compatible field types listed
Use this reference to fill in valid values for the field_type, widget, and formatter columns. The reference sheet is skipped during import.
Spreadsheet format
Each worksheet in your spreadsheet becomes a content type:
- The sheet name becomes the content type label
- The machine name is auto-generated from the sheet name (slugified to lowercase with underscores)
- Row 1 is the header row with column names
- Rows 2+ are field definitions
Columns
| Column | Required | Description |
|---|---|---|
label | Yes | Human-readable field name (e.g. 'Hero Image') |
machine_name | Yes | Field machine name. Auto-prepends field_ if missing. Must match ^field_[a-z0-9_]+$, max 32 chars. |
field_type | Yes | Drupal field type from the registry (e.g. text_long, entity_reference, image) |
widget | No | Form widget. Must be compatible with the field type. Defaults to the first compatible widget. |
formatter | No | Display formatter. Must be compatible with the field type. Defaults to the first compatible formatter. |
required | No | Whether the field is required. Accepts "yes", "true", or "1". Defaults to false. |
cardinality | No | Number of values. Use -1 for unlimited. Defaults to 1. |
description | No | Help text shown below the field on Drupal forms. |
target_entity_type | Conditional | Required for entity_reference and entity_reference_revisions fields. Values: node, taxonomy_term, media, user, paragraph, block_content. |
target_bundles | No | Comma-separated list of target bundle machine names for entity reference fields. |
Column headers are flexible — Strata recognizes common aliases. For example, “Field Type”, “field type”, “type”, and “fieldtype” all map to field_type.
Validation
The parser validates every content type and field before import:
- Required columns (
label,machine_name,field_type) must be present in the header row - Content type machine names must not already exist in the project
- Each field must have a label, machine name, and field type
- Machine names must match the pattern
^field_[a-z0-9_]+$and be at most 32 characters - Duplicate machine names within a sheet are rejected
- Field types must exist in the project's registry (version-filtered)
- Widgets and formatters must exist in the registry and be compatible with the selected field type
- Entity reference fields must specify a
target_entity_type - Cardinality must be a valid integer (-1 for unlimited)
Validation errors are reported per-field with the sheet name, row number, and specific error message. All errors are shown in the preview before import.
Selective import
After the preview, you can select which content types to import using checkboxes. You do not have to import everything in the spreadsheet.
Strata automatically resolves dependencies: if a content type you select has entity reference fields pointing to other content types in the spreadsheet, those referenced types are automatically included. This ensures referential integrity — you cannot import a content type with a reference to a bundle that does not exist.
What gets created
When you confirm the import, Strata creates:
- Content type entries in the Content Types tab, with auto-generated machine names
- Field entries as children of each content type, with resolved registry references for field types, widgets, and formatters
- Default displays — Form Display and View Display entries are created automatically (the same as when you add a content type manually)
- Change events — all created entries are tracked in the current draft changeset
Entity reference fields have their target bundles resolved to actual entry IDs where possible. If a referenced bundle does not exist (and is not being imported), the target bundle reference is omitted rather than failing the import.
Tips
- Download the template first to see the exact format and available registry values for your project
- Name your sheets clearly — the sheet name becomes the content type label as-is
- Use the Reference sheet to look up valid field types, widgets, and formatters
- Leave the
widgetandformattercolumns blank to let Strata pick compatible defaults - For entity reference fields, make sure the target bundles are either already in the project or included in the same spreadsheet