🚧 FastCMS is under active development — not ready for production use. APIs and features may change without notice.
FastCMS
Data Management

CSV Import / Export

Import and export collection data in CSV format — compatible with Excel, Google Sheets, and data migration workflows.

CSV Import / Export

FastCMS allows you to easily import and export data from collections in CSV format. This is useful for data migration, backups, bulk editing, and integration with spreadsheet applications like Excel or Google Sheets.

Via Admin Dashboard

Exporting Records to CSV

  1. Navigate to any collection's records page (e.g., /admin/collections/products/records)
  2. Click the Export CSV button at the top of the page
  3. Your browser will download a CSV file named {collection_name}_export.csv

The exported CSV includes:

  • System fields: id, created, updated
  • All custom fields defined in the collection schema

Importing Records from CSV

  1. Navigate to the collection's records page
  2. Click the Import CSV button
  3. Select your CSV file in the modal dialog
  4. Optionally check Skip validation to import all data as text without type checking
  5. Click Import

Important Notes:

  • The first row must contain field names matching your collection schema
  • System fields (id, created, updated) will be ignored if present
  • Empty values are skipped
  • Invalid data types will cause errors (unless "Skip validation" is checked)

Via API

Export Records to CSV

curl -X GET "http://localhost:8000/api/v1/collections/products/records/export/csv" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -o products_export.csv

With Filters and Sorting:

curl -X GET "http://localhost:8000/api/v1/collections/products/records/export/csv?filter=active=true&sort=-price" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -o active_products.csv

Query Parameters:

ParameterDescription
filterFilter expression (e.g., price>=100&&active=true)
sortSort field (prefix with - for descending)

Export Limit: Maximum 10,000 records per export.

Import Records from CSV

curl -X POST "http://localhost:8000/api/v1/collections/products/records/import/csv" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -F "file=@products.csv"

Response:

{
  "imported": 95,
  "total": 100,
  "errors": [
    {
      "row": 23,
      "error": "Row 23, field 'price': Cannot convert 'invalid' to number"
    }
  ]
}

With Skip Validation:

curl -X POST "http://localhost:8000/api/v1/collections/products/records/import/csv?skip_validation=true" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -F "file=@products.csv"

CSV Format

Simple Example

name,price,active
Laptop,999.99,true
Mouse,29.99,true
Keyboard,79.99,false

Field Type Formatting

Field TypeFormat
DatesISO 8601: 2025-01-15T10:00:00
Booleanstrue/false, 1/0, yes/no
Multi-select arraysJSON: ["electronics", "sale"]
Text with commasWrap in double quotes

Example with multiple field types:

title,quantity,published,publish_date,tags
"First Product",100,true,2025-01-15T10:00:00,"[""electronics"", ""sale""]"
"Second Product",50,false,2025-02-01T14:30:00,"[""clothing""]"

Data Migration Workflow

Export from one collection, import into another:

# Step 1: Export source collection
curl -X GET "http://localhost:8000/api/v1/collections/old_products/records/export/csv" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -o products_backup.csv

# Step 2: Import to target collection
curl -X POST "http://localhost:8000/api/v1/collections/new_products/records/import/csv" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -F "file=@products_backup.csv"

Handling Large Datasets

For collections with more than 10,000 records, export in batches using filters:

# Export with sort to enable cursor-based pagination
curl "http://localhost:8000/api/v1/collections/products/records/export/csv?filter=id>0&sort=id"

For import, split your CSV into files of 5,000 records each and import sequentially.

Troubleshooting

ProblemSolution
"Invalid CSV format"Ensure first row contains field names
Partial successCheck errors array for specific row errors
Boolean not workingUse accepted formats: true/false, 1/0, yes/no
Dates import as textUse ISO 8601 format: 2025-01-15T10:00:00
Special charactersEnsure UTF-8 encoding, wrap in double quotes

Access Control

OperationRequired Permission
Exportlist_rule on the collection
Importcreate_rule on the collection

On this page