Skip to main content

Bulk importer

The Bulk Importer is a subsystem of the Generic API page that lets an external system (or another Business Central installation) read and write the data of any table directly, in JSON format. It is designed for bulk data transfers such as migrations, alignments between companies or environments and initial loads, including G/L, inventory and fixed asset entries and posted documents.

There are no pages or actions to use inside Business Central: the feature is used through the API.

In requests to the Generic API page specify:

  • Subsystem: Bulk Importer;
  • Procedure: one of the procedures described below;
  • Content: a JSON object with the procedure parameters.
Parameter Description
tableName Name of the table to work on (required for all procedures except TABLES).
lines List of records to insert, modify or delete. Each record is an object with one value per field.
view Table filter, in the standard Business Central view format.
fields List of fields returned by the search; if empty, all fields are returned.
position Position from which to continue reading (returned by the previous search).
limit Maximum number of records returned by the search (default 1000).
tryCommand If true, missing or already existing records are skipped instead of raising an error.
fieldNames If true, fields are identified by their original name; otherwise by their JSON name (see below).
Procedure Description
TABLES Returns the list of available tables with name, number and whether data is per company.
SCHEMA Returns the table structure: fields, English captions, type, length, primary key membership and, for option fields, the allowed values.
FIND Reads the table records, applying the optional filter, field selection and limit. Returns the records and the position of the last one read, to be used to read the next block.
INSERT Inserts the given records. With tryCommand, already existing records are skipped.
MODIFY Modifies the given records, finding them by primary key. With tryCommand, records not found are skipped.
UPSERT Modifies existing records and inserts missing ones.
DELETE Deletes the given records, finding them by primary key. With tryCommand, records not found are skipped.
TRUNCATE Deletes all table records, or only those matching the given filter.
  • Field names: by default the field name is converted to JSON format: only letters and numbers are kept, dots are removed, other characters are replaced by an underscore and words are joined in camel case (e.g. Posting Date becomes postingDate).
  • Dates: yyyy-MM-dd format; closing dates are prefixed with the letter C (e.g. C2025-12-31). An empty date is sent as empty text.
  • Times and date/times: ISO format; an empty value is sent as empty text.
  • Decimals, GUIDs and date formulas: text in the standard language-independent format.
  • Options: numeric value.
  • BLOB and image fields: sent in Base64 when writing; not returned when reading.
  • Only normal fields are considered (not calculated fields).
  1. Use TABLES to find the table name.
  2. Use SCHEMA to get the fields and their JSON names.
  3. Read data with FIND; if there are more records than the limit, repeat the request passing the returned position until no more records are returned.
  4. Write data with INSERT, MODIFY or UPSERT, or delete it with DELETE or TRUNCATE.
  • Records are written directly, without running the standard field validations and logic: data must already be consistent.
  • If an error occurs on a record, the whole request is rolled back (except for cases handled with tryCommand).
  • Uploaded images are stored in the current company and linked to the record.