Skip to content

Data Import & Export

Rebase includes built-in data import and export tools accessible directly from the admin panel. Import supports CSV, JSON, and Excel files with a column-mapping wizard. Export supports CSV and JSON with optional computed fields.

Both are available on every collection. Export can be configured per collection with computed fields; neither can be switched off per collection.

  1. Open a collection in the admin panel
  2. Click the Import button in the toolbar
  3. Select or drag-and-drop your file
  4. Map file columns to collection properties
  5. Preview the data and resolve any validation errors
  6. Click Import to save all entities
Format Extensions Notes
CSV .csv Auto-detects delimiters
JSON .json Expects an array of objects
Excel .xlsx Reads the first sheet

The import wizard automatically attempts to match file columns to collection properties by name. You can manually adjust mappings before importing:

  • Exact matches are mapped automatically (e.g. namename)
  • Unmatched columns can be mapped manually or skipped
  • Type coercion handles string-to-number, string-to-boolean, and date parsing

Before importing, the wizard validates all rows against your collection’s property definitions:

  • Required fields must be present
  • Enum values must match defined options
  • Data types must be compatible (e.g. a text value for a number field is flagged)
  • Validation errors are shown per-row so you can fix them before importing

Import is available on every collection. There is no per-collection setting that turns it off.

  1. Open a collection in the admin panel
  2. Optionally apply filters to export a subset of data
  3. Click the Export button in the toolbar
  4. Choose the format: CSV or JSON
  5. The file downloads immediately
Format Description
CSV Comma-separated values, compatible with Excel and Google Sheets
JSON Array of objects, useful for programmatic consumption

Any active filters in the collection view are applied to the export. This lets you export only a subset of your data:

  • Apply column filters or search terms in the collection view
  • Click Export — only the filtered rows are included

Export is available on every collection. admin.exportable configures it: give it an ExportConfig to add computed columns, below. The type also accepts a boolean, but nothing reads it — exportable: false does not remove the Export button.

Use the ExportConfig object to add custom computed columns to your exports. These columns don’t exist in the database — they are calculated at export time:

import { defineCollection } from "@rebasepro/cms-types";
const productsCollection = defineCollection({
slug: "products",
table: "products",
name: "Products",
properties: { /* ... */ },
admin: {
exportable: {
additionalFields: [
{
key: "computed_margin",
builder: ({ entity }) => {
const price = entity.values.price as number;
const cost = entity.values.cost as number;
return String(price - cost);
}
},
{
key: "full_url",
builder: ({ entity }) => {
return `https://mystore.com/products/${entity.id}`;
}
}
]
}
}
});

Each additionalFields entry has:

Property Type Description
key string Column name in the export
builder ({ entity, context }) => string | Promise<string> Function that computes the value

The builder function receives the current entity and the RebaseContext (which includes the authenticated user), so you can compute values based on both data and permissions.

The builder function can be async, which is useful when the computed value requires a database lookup or API call:

exportable: {
additionalFields: [
{
key: "author_name",
builder: async ({ entity, context }) => {
const author = await context.data.users.findById(
entity.values.authorId as string
);
return author?.values.displayName ?? "Unknown";
}
}
]
}