Skip to content
CSV-/TXT-Import mit Data Exchange Framework

How-To Import variable CSV/TXT Files with the Data Exchange Framework into any Table

Daniel Gorski
Daniel Gorski 17. Mai 2022
2 Min. Lesezeit

Do you use the Data Exchange Framework inside Dynamics 365 Business Central?

No? Get the documentation here:

You can use the Data Exchange Framework to manage the exchange of business documents, bank files, currency exchange rates, and any other data files with your business partners.

👉 Microsoft Docs – Data Exchange Framework


In our case we would like to import German post codes directly into the Post Code table (225) in Business Central.

So that framework would fit our needs, right?

Our code example on GitHub will extend the Data Exch Def Card (1210) by an action "Import File". So you can jump into any Data Exchange Definition and select your file to import it directly into BC.

👉 See the CSV Importer code


📦 Import Showcase: Customers

Import Preview

Import in Action


It can be also imported by using "Configuration Packages" but I am frustrated of using excel files.

So in our examlple we are importing nearly 17.000 post codes and this took 2 mins and 45 seconds on my local sandbox. The big advantages is that you can leave the "Columns Definitions" as it is and I don't need to transform the original csv file to excel (and maybe some extra work on throwing columns out).

This is how it looks like:

Walkthrough of opening the POSTCODES data exchange definition, using Import File to choose PLZ_codes.csv, and the resulting summary showing 16,478 lines imported in under three minutes


We are using one regular expression to split each line into columns:

(?:^|%1)(?=\[^"\]|(")?)"?((?(1)\[^"\]\*|\[^%1"\]\*))"?(?=%1|$)

where %1 can hold any column separator you want. Like a comma, pipe or semicolon. Also field delimiters are handled here.

We've prepared one simple snippet on regex101.com to play around with. Give it a try ;-)


The other way around would be to use Configuration Packages:

Config Package


Get the code from here:

https://github.com/byndit/BeyondAL/tree/main/BeyondAL/src/CSVimporter

beyondit
how-to
Business Central
Data Exchange Framework
CSV Import
Open Source
Regex
EN
E-Invoicing formats UBL, CII, ZUGFeRD and Factur-X compared

E-Invoicing

July 21, 2026 - Daniel Gorski

UBL, CII, ZUGFeRD, Factur-X: E-Invoicing Formats Finally Explained

UBL, CII, ZUGFeRD or Factur-X – these e-invoicing formats get confused all the time. We break down the difference between pure XML formats and hybrid…

Read More
Read More: UBL, CII, ZUGFeRD, Factur-X: E-Invoicing Formats Finally Explained
DE
GoBD-konforme Archivierung mit Business Central und SharePoint ohne DMS

Architektur

April 24, 2026 - Sven Wischhusen

Revisionssicher archivieren ohne DMS? Wie weit Business Central, SharePoint und Azure Blob Storage wirklich tragen

Warum „GoBD" oft vorschnell zum K.O.-Kriterium wird – und wie weit Business Central, SharePoint und Azure Blob Storage wirklich tragen.

Read More
Read More: Revisionssicher archivieren ohne DMS? Wie weit Business Central, SharePoint und Azure Blob Storage wirklich tragen