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

  1. User clicks "Export to CSV" in the list actions dropdown.
  2. The frontend fetches all records matching the current filter and sort order (pagination is ignored).
  3. The exporter mapper converts each entity to a flat object with CSV-friendly string values.
  4. PapaParse generates the CSV content with localized column headers.
  5. The browser downloads the file via FileSaver.

Field type formatting

Each field type is converted to a string suitable for CSV:

Field typeExport formatExample
TextAs-isJohn Doe
IntegerNumber string42
DecimalLocale-formatted string1,299.99
DateISO date (date part only)2024-06-15
DatetimeISO datetime string2024-06-15T14:30:00.000Z
BooleanLocalized "Yes" / "No"Yes
EnumeratorTranslated labelActive
Enumerator multipleComma-separated labelsAdmin, Member
TagsComma-separated valuesurgent, important
Files / ImagesExcluded 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: false in the field's properties
  • Relationships — set exportA: false or exportB: false on 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

FilePurpose
src/features/{entity}/{entity}ExporterMapper.tsConverts entities to CSV-ready flat objects
src/features/{entity}/components/{Entity}ListActions.tsxExport button in list actions dropdown
src/shared/lib/csvExporter.tsPapaParse + FileSaver CSV generation and download