← All guides

Data Exchange Definitions: Importing Bank and Carrier Files Without Custom Code

Data, integrations & replication · 6 min read · By Dex Carter · Published 2026-10-26 · Last updated 2026-10-26

Columned sheets on the left flowing through a large funnel into a small filing cabinet
Columns in, filed records out, the definition sits in the funnel.

A data exchange definition is Business Central’s reusable description of an external file: which lines it has, which columns sit on those lines, and which fields those columns fill in a target table. Set the description up once, attach it where a process looks for it, and the same file shape can be imported repeatedly without custom code.

One honesty note before the runbook. The documented, worked examples for this framework are bank files. No documented carrier-file walkthrough was found in the research behind this article, so the carrier case here is the bank-file mechanics applied to a retail file, a pattern to test with a real sample, not a promised walkthrough.

What a data exchange definition actually is

The framework is already at work in standard processes. SEPA bank statement import is performed by the Data Exchange Framework and represented by the SEPA CAMT data exchange definition, and import starts from the Payment Reconciliation Journal and Bank Acc. Reconciliation pages. A definition also powers the currency exchange-rate update service, configured on the Exch. Rate Update Setup Card.

For XML files, the entry point is different: load the schema on the XML Schema Viewer page, select the elements to exchange, and then initialise a data exchange definition or generate an XMLport.

So a definition is not an import file. It is the standing map between a file shape and a table, reused each time that shape arrives.

Anatomy: lines, columns and field mapping

A definition is built on three FastTabs: General, Line Definitions, and Column Definitions. Field mapping, the step that says which column becomes which field, is done from the Header line, through Manage, then Field Mapping.

Two real definitions show how concrete that anatomy gets. Both map to Table 274, and both run on the same engine parts:

SpecHSBC definitionLloyds definition
File shape5-column CSV8-column CSV
Header lines12
TargetTable 274Table 274
Reading engineXMLport 1220XMLport 1220
Processing / mappingCodeunit 1240 / Codeunit 1248Codeunit 1240 / Codeunit 1248
Notable columns—Posting Date, Amount, Customer Reference (optional), Transaction Detail (optional)

Spec verification, in one line: the file’s header-line count is part of the definition, not a detail to eyeball, the two bank examples differ on exactly that point, 1 against 2, and a definition built with the wrong count reads the wrong lines as data.

Runbook: build a definition from a real sample file

  1. Start from a preconfigured definition where one exists. Preconfigured definitions exist for common tasks such as importing bank statements; use one as the starting point for a custom definition instead of building from a blank card.
  2. Get the sender’s real sample file. Work from an actual bank or carrier file, not a description of one. The columns, header lines, and date style in that file are the specification.
  3. Number the columns. From the sample CSV, number the file’s columns and match them on the definition, the worked example uses Date, Check No. Description, and Amount.
  4. Build the line and column definitions. On the definition, fill in the General, Line Definitions, and Column Definitions FastTabs so the lines and columns match the sample, including its exact number of header lines.
  5. Map columns to fields. From the Header line, choose Manage, then Field Mapping, and map each column to its field in the target table.
  6. Set the date column’s Culture and Format. For the posting date column, set the Culture and Format that match how dates are actually written in the file. This step has its own section below, because it is the documented failure point.
  7. Attach the definition where the process looks for it, then test. For a bank import, that is the definition named on the Bank Account Card. Run the import with the sample file before any live file is trusted.

What success looks like: the sample file imports with its header lines skipped rather than treated as data, every mapped column lands in the field the mapping named, and the posting dates read as the dates written in the file, not shifted, swapped, or rejected.

The format traps: dates, amounts, header lines and optional columns

Dates first. A real bank-import problem was traced to exactly one place: the Data Exchange Definition named on the Bank Account Card, where the Posting Date Column Definition needed the correct Culture and Format. When dates fail, check that column definition before rebuilding anything else.

Header lines. The HSBC and Lloyds definitions differ by a single header line. Copying a working definition and keeping its header count while the new file adds a title row produces a definition that is wrong by one line everywhere.

Optional columns. In the Lloyds definition, Customer Reference and Transaction Detail are optional. A retail file with sometimes-present columns needs the same decision made explicitly in the mapping, rather than an assumption that every row carries every column.

Amounts and the remaining columns. Treat each column definition as a claim about the sample file, and re-check the claims against a fresh sample whenever the sender changes the file. A definition is only as current as the last sample it was verified against.

Attach and test: where processes pick the definition up

A definition does nothing until a process points at it. Three attachment points are documented:

Test in that order: confirm the process names the definition just built, run the real sample through it, and read the result field by field against the sample. Only then let a live file use it.

When the framework is the wrong tool and code is justified

The framework’s strength is a stable file shape mapped to a table. Its documented shape is lines, columns, and field mapping, powered by a reading XMLport and processing and mapping codeunits.

So the decision is practical. If the file’s shape can be described as lines and columns and mapped to fields, the bank pattern, and the carrier pattern as far as the sample file matches it, build the definition and keep the code at zero. If a sender’s file cannot be described that way after a real sample has been tried, that failed attempt is the evidence that custom work needs a separate case, not a starting assumption.

Either way, the sample file decides. Not the sender’s documentation, and not optimism.

, Dex Carter, Tech Writer

Keep readingNext: Bank reconciliation for retail stores: matching deposits and card settlements without the month-end pile-up →