Data Importer

Last modified: November 20, 2026

Introduction

Data Importer lets you define how data from Excel and CSV files is interpreted in your Mendix app. You create a Data Importer document based on an input file.

The document can be used in two ways:

  • With the Import data from file activity, to import the file into a generated non-persistable entity.
  • As a source for an import mapping, which gives you more control over how imported data is mapped to Mendix objects.

Creating a Data Importer Document

To create a Data Importer document, follow the steps below:

  1. Right-click the module where you want to add the Data Importer document, then click Add other > Data Importer.
  2. Enter a name for the document, then click OK.

The new Data Importer document opens.

Previewing Data

After creating the Data Importer document, click Upload File in Select file from local to upload an Excel file (.xls or .xlsx) or CSV file (.csv). You can upload a file up to 10 MB size.

An Excel workbook can have one or multiple sheets. Choose which sheet to import data from and configure the Excel file settings below:

  • Sheet Name – the name of the worksheet to import. If the workbook has multiple worksheets, their names appear in the drop-down list.
  • Header Row No. – row number of the file header; the default is 1.
  • Read Data From – the row where data reading starts; the default is 2.

CSV import supports multiple combinations of delimiter, quote, and escape characters. It also supports files without a header row. Configure the following settings:

  • Delimiter (Separator) – Supported delimiters are comma, semicolon, pipe, and tab. The default is comma.
  • Quote Characters – Supported quote characters are single quotes and double quotes. The default is double quotes.
  • Add Header Row – Specify whether to add a header row or whether the CSV file already includes one. By default, the file already includes a header row.
  • Escape Character – Supported escape characters are backslash, single quotes, and double quotes. The default is double quotes.

Click Preview Data to view the data from the selected file.

Data Importer creates the data structure based on the first ten rows of the source file and displays it in the Source elements section. If the file settings do not provide valid data, an error is displayed. To modify Custom Name or Primitive Type, edit the values directly in the source elements table, and the changes will automatically update in the module.

You can now use the data importer document in the import mapping. For more information, see the Using in an Import Mapping section below.

Mapping to an Entity

After previewing the data, go to the Mapping tab. You can either create a new entity based on the structure elements, or map the data to an existing non-persistable entity.

Creating an Entity

To create a new entity for the imported data, click Create Entity. In the dialog box:

  • Change the entity Name.
  • To rename the Attributes or to change attribute data type, use Custom Name and Primitive Type in the Source Element tab first.
  • Select which columns to include in the entity by selecting or clearing the checkbox next to each column.

Click Create to create the entity. This creates the entity in your domain model and displays a confirmation message. The Data Importer document is then ready to use in Import Data from File to import data. For more details, see the Using in the Import Data from File Activity section below.

Selecting an Existing Entity

To map the imported data to an existing non-persistable entity instead of creating a new one, click Select on the Mapping tab. Select the entity in the dialog box and click Select.

The Mapping tab then displays a table for mapping each imported column to an attribute of the selected entity. To map the columns, do one of the following:

  • Select an attribute for each column manually from the drop-down list.
  • Click Map attributes by Name to automatically map columns to attributes with matching names.

To change the source file at any point, click Remove File, upload a new file, and reconfigure the document. Note that removing the file clears all structure elements and configured mappings.

Using a Data Importer Document

You can use a Data Importer document in two ways:

  • For simple use cases, directly in the Import data from file activity to import data into non-persistable entities (NPEs).
  • As the schema source for an import mapping, when you need more control over how data is mapped to Mendix objects.

Using in the Import Data from File Activity

After creating the entity, you can use the Data Importer document in the Import Data from File activity to import data into a list of NPEs.

You can extend this further. For example, you can convert the list of NPEs into persistable entities by providing a message definition, or use a loop to create and commit entities to your database individually.

Using in an Import Mapping

After the document is created and its Structure elements are populated, you can use the Data Importer document in an import mapping by selecting Excel/CSV Structure as the Schema source. The structure elements defined in the Data Importer document become the schema that you map to your Mendix entities and attributes.

This approach gives you more control than the Import data from file activity. You can map imported data to existing persistable entities, find existing objects by key instead of always creating new ones, set associations between mapped objects, and apply conversion microflows to transform attribute values during import. For more information, see Import Mappings.