Entity export
Every entity list includes a CSV export that downloads all records matching the current filter. Export runs entirely client-side — the backend returns JSON, and the browser generates the CSV file.
How it works
- User clicks "Export to CSV" in the list actions dropdown.
- The frontend fetches all records matching the current filter and sort order (pagination is ignored).
- The exporter mapper converts each entity to a flat object with CSV-friendly string values.
- PapaParse generates the CSV content with localized column headers.
- The browser downloads the file via FileSaver.
Field type formatting
Each field type is converted to a string suitable for CSV:
| Field type | Export format | Example |
|---|---|---|
| Text | As-is | John Doe |
| Integer | Number string | 42 |
| Decimal | Locale-formatted string | 1,299.99 |
| Date | ISO date (date part only) | 2024-06-15 |
| Datetime | ISO datetime string | 2024-06-15T14:30:00.000Z |
| Boolean | Localized "Yes" / "No" | Yes |
| Enumerator | Translated label | Active |
| Enumerator multiple | Comma-separated labels | Admin, Member |
| Tags | Comma-separated values | urgent, important |
| Files / Images | Excluded by default | — |
Relationships in export
Relationships are resolved to human-readable labels:
- One-to-one — displays the related entity's display label (e.g., a customer name instead of a UUID)
- Many-to-many — comma-separated list of labels
Audit fields are always included: createdByMember, createdAt, updatedByMember, updatedAt, and archivedByMember / archivedAt for archivable entities.
Filter-aware export
Export respects the current filter and sort order on the list page. It does not respect pagination — all matching records are exported regardless of the current page. This means:
- Applying a date range filter exports only records in that range
- Sorting by a column determines the row order in the CSV
- With no filter applied, all records are exported
Disabling export for fields
You can exclude specific fields or relationships from export in your entity schema:
- Fields — set
export: falsein the field's properties - Relationships — set
exportA: falseorexportB: falseon the relationship
Excluded fields won't appear as columns in the CSV.
Permissions
Export requires the export permission for the entity. The export button only appears in the list actions if the current user's role grants this permission. Both the admin and member roles have export permission for all custom entities by default.
Key files
| File | Purpose |
|---|---|
src/features/{entity}/{entity}ExporterMapper.ts | Converts entities to CSV-ready flat objects |
src/features/{entity}/components/{Entity}ListActions.tsx | Export button in list actions dropdown |
src/shared/lib/csvExporter.ts | PapaParse + FileSaver CSV generation and download |