CSV.Records.Get

Outbound  Content-Type: text/csv

Exports all matching records from a specified Business Central table as a UTF-8 encoded CSV file in Open Mirroring format. For large result sets that approach the 2 GB OutStream limit, a continuation pattern is supported via continueFromRecordId.

Request Parameters

Parameter Location Type Required Description
subject CloudEvents envelope string One of table ID params Table name (e.g. "Customer") or table number (e.g. "18")
continueFromRecordId CloudEvents envelope GUID No SystemId of the record to resume from. Omit or leave empty for the first request.
tableName JSON data string One of table ID params Table name, e.g. "Customer"
tableNumber / tableNo / tableId JSON data integer One of table ID params Table number, e.g. 18
fieldNumbers JSON data array of integers No Specific field numbers to include. If omitted, all supported normal fields are included.
startDateTime JSON data ISO 8601 datetime No Filter by SystemModifiedAt >=
endDateTime JSON data ISO 8601 datetime No Filter by SystemModifiedAt <=
tableView JSON data string No BC AL table view filter in SetView format

Note: skip and take are not supported. Use the continuation pattern for large exports.

Response Format

When records match, a UTF-8 encoded CSV text is returned with content type text/csv. The first row is the header; subsequent rows are data rows. If no records match, both data and datacontenttype are empty.

Example CSV

No,Name,timestamp,SystemId,SystemCreatedAt,SystemCreatedBy,SystemModifiedAt,SystemModifiedBy,$Company,__rowMarker__
"10000","Contoso Ltd.",0,"a1b2c3d4-...",2026-01-10T08:00:00.000Z,"user-guid",2026-03-01T12:30:00.000Z,"user-guid","CRONUS International Ltd.",4

Column Naming Convention

Each column header is formed by stripping non-alphanumeric characters (except %) from the BC field name. Examples:

BC Field NameColumn Header
No.No
Sell-to Customer No.SelltoCustomerNo
SystemIdSystemId

System Fields

Always appended at the end of every row, regardless of fieldNumbers:

ColumnField No.Description
timestamp0Internal timestamp (BigInteger)
SystemId2000000000Record GUID
SystemCreatedAt2000000001Creation timestamp (UTC)
SystemCreatedBy2000000002Created by user GUID
SystemModifiedAt2000000003Last modified timestamp (UTC)
SystemModifiedBy2000000004Last modified by user GUID

Special Columns

Continuation Pattern (Large Exports)

When the CSV response approaches the 2 GB OutStream limit, the export stops after the current 4 MB chunk and returns the SystemId of the next unprocessed record in the continueFromRecordId response field.

Workflow

  1. Send a normal CSV.Records.Get request (no continueFromRecordId).
  2. Check the continueFromRecordId field in the response.
  3. If it contains a GUID, send another request with continueFromRecordId set to that value.
  4. Repeat until the response continueFromRecordId is empty (all records exported).

Example — First Request

{
  "specversion": "1.0",
  "type": "CSV.Records.Get",
  "source": "my-integration",
  "subject": "Item Ledger Entry",
  "datacontenttype": "application/json",
  "data": {}
}

Example — Continuation Request

{
  "specversion": "1.0",
  "type": "CSV.Records.Get",
  "source": "my-integration",
  "subject": "Item Ledger Entry",
  "continueFromRecordId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "datacontenttype": "application/json",
  "data": {}
}

Important Notes

Error Handling

ConditionResponse
Table not identified Error raised by table evaluation
Table is internal/restricted Table {n} ({name}) cannot be read via CSV.Records.Get. This is an internal table.
Read permission denied Read permission denied for table {n}.
continueFromRecordId points to non-existent record Unable to locate the record in table {name} with System Id {guid}
No records match filters Task succeeds; data and datacontenttype are both empty
Unsupported field type Field silently skipped

Related Message Types