Skip to content

Export data

Stack9 allows to export entity data to a CSV. If no configuration is provided, all entity fields will be exported.

Configuration

In the entity definition JSON file, customise what fields should be part of the export:

 "exportSettings": {
    "useFieldKeyAsHeader": false,
    "columnDefs": [
      { "headerName": "Text Field", "field": "text_field" },
      { "headerName": "Id", "field": "id" },
      { "headerName": "Updated At", "field": "_updated_at" }
    ]
  }

Definition

useFieldKeyAsHeader - bool (optional, default false) - Choose between columnDefs.headerName or the field.key defined in the entity as column header name.

columnDefs - array (optional) - List of fields to be exported.

columnDefs.headerName - string (optional) - Label for the column header.

columnDefs.field - string (required) - Field key or association path for many-to-one (*) fields

(*) one-to-many fields relationship are not supported.

Endpoint

POST /:entity_type/export

Querystring limit=[integer]&page=[integer]
Body [query criteria]
Success code 200
Response type byte[]

Sample Call:

POST /user/export?limit=100
{
  "$where": { "is_active": true }
}