> For the complete documentation index, see [llms.txt](https://developer.emporix.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.emporix.io/import-tool/import-configuration-examples/auto-mapping-custom-entities.md).

# Importing Custom Entities with Auto-Mapping

Create a custom entity type and mixin schema from a CSV import with Map from source, without defining the schema in Management Dashboard first.

This example imports vendors from a CSV file into a custom entity type that does not exist yet. You enter a new **Target type** name, map fields with **Map from source**, and let the first import create the type and mixin schema in Emporix.

{% hint style="info" %}
Use this flow when you want the custom entity schema to come from the import data itself. To map into a type you already created in Management Dashboard, follow [Importing Using CSV](https://developer.emporix.io/import-tool/import-configuration-examples/csv-example.md) instead.

Complete the Emporix [Prerequisites for the Import Tool](https://developer.emporix.io/import-tool/import-setup-and-jobs/prerequisites.md) first. For connection and stream UI details, see [Connections](https://developer.emporix.io/import-tool/import-setup-and-jobs/connections.md), [Creating Streams](https://developer.emporix.io/import-tool/import-setup-and-jobs/imports/creating-streams.md), and [Field Mapping](https://developer.emporix.io/import-tool/import-setup-and-jobs/imports/field-mapping.md).
{% endhint %}

## Before you start

Prepare the following before you start:

* A CSV file with a header row and a stable key column
* Permission to create custom entity types and run imports

You do not need to create the custom entity type or mixin schema in Management Dashboard first.

## Download and prepare the sample

{% file src="/files/4aLWmYBYTS7gMTJ3ojMG" %}

```csv
vendorId,vendorName,country,status
V-1001,Nordic Living,DE,ACTIVE
V-1002,Luma Lighting,PL,ACTIVE
V-1003,ProSpace Storage,FR,ACTIVE
V-1004,Alpine Tools,AT,ACTIVE
V-1005,Coastal Parts,NL,INACTIVE
```

This walkthrough uses the type name `AUTO_VENDOR`. Choose another capitalized type name if `AUTO_VENDOR` already exists in your tenant.

| Column       | Role in this example                                |
| ------------ | --------------------------------------------------- |
| `vendorId`   | Stream **Key field** and mapped as the instance key |
| `vendorName` | Mapped as a mixin attribute                         |
| `country`    | Mapped as a mixin attribute                         |
| `status`     | Mapped as a mixin attribute                         |

## Create the File stream

{% stepper %}
{% step %}

#### Create the connection and import

Follow [Importing Using CSV](https://developer.emporix.io/import-tool/import-configuration-examples/csv-example.md#create-a-file-connection) to create a **File** connection and upload `vendors-sample.csv` as the sample file. Create an import if you do not have one yet.
{% endstep %}

{% step %}

#### Create the stream with a new target type

Choose **+ New stream** and set:

* **Name** – `Auto Vendor Import`
* **Connection** – the File connection you created
* **Source record** – `vendors-sample.csv`
* **Key field** – `vendorId`
* **Target** – **Custom entity (Schema Service)**
* **Target type** – `AUTO_VENDOR`

Enter `AUTO_VENDOR` in the editable **Target type** box. Because the type does not exist yet, the dialog warns you that the Import Tool will create it. Choose **Create stream**.

<figure><img src="https://2637457592-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9VS91qn3Ylwd58YivX1A%2Fuploads%2Fgit-blob-dd1e1cb93a36ef688365363a7d7d555f21af9256%2Fit_auto_stream.png?alt=media" alt="Create a new type dialog warning that AUTO_VENDOR will be created on the first run" width="500"><figcaption><p>Warning when the target type does not exist yet</p></figcaption></figure>

{% hint style="info" %}
This walkthrough uses **Custom entity (Schema Service)** as a practical example. Other targets can also use a typed **Target type** name when you create a stream. The same target choices are available for Celonis, HTTP / REST API, and File connections.
{% endhint %}
{% endstep %}

{% step %}

#### Queue the CSV for import

Open the stream **Files** tab and upload `vendors-sample.csv` so it appears under **Waiting to import**. The sample file on the connection is only for discovery. See [Files](https://developer.emporix.io/import-tool/import-setup-and-jobs/imports/configuring-streams.md#files).

<figure><img src="https://2637457592-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9VS91qn3Ylwd58YivX1A%2Fuploads%2Fgit-blob-3a6b1e37a3b6d08b35c42109b5df5029550c256d%2Fit_auto_file.png?alt=media" alt="Files tab with vendors-sample.csv waiting to import for Auto Vendor Import"><figcaption><p>CSV queued on the stream Files tab</p></figcaption></figure>
{% endstep %}
{% endstepper %}

## Map from source and publish

{% stepper %}
{% step %}

#### Open Field Mapping

On the stream row, choose the pencil icon or **Edit mapping** to open Field Mapping.
{% endstep %}

{% step %}

#### Fetch a sample and map from source

Choose **Fetch sample**, then **Map from source**. The Import Tool proposes target fields from the CSV columns so the first import can create the mixin schema. Adjust any rows that did not match, then confirm in **Preview** that `vendorId`, `vendorName`, `country`, and `status` look correct.

<figure><img src="https://2637457592-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9VS91qn3Ylwd58YivX1A%2Fuploads%2Fgit-blob-231f5b0ead81a74c39bbdfca68c0351e12300801%2Fit_auto_mapping.png?alt=media" alt="Field Mapping for AUTO_VENDOR with four CSV columns mapped after Map from source"><figcaption><p>Field Mapping after Map from source for the new AUTO_VENDOR type</p></figcaption></figure>

You must map fields before you can save. For details about transforms and publishing, see [Field Mapping](https://developer.emporix.io/import-tool/import-setup-and-jobs/imports/field-mapping.md).
{% endstep %}

{% step %}

#### Save and publish

Choose **Save**, then **Publish**. Until you publish, real runs use the last published mapping, or fail if nothing is published yet.
{% endstep %}
{% endstepper %}

## Run the import and review results

{% stepper %}
{% step %}

#### Dry run, then run a full import

In the import details view, choose **Dry run** to validate without writing. Then open **Run options** and run a full import. See [Running and Monitoring Imports](https://developer.emporix.io/import-tool/import-setup-and-jobs/imports/running-imports.md).
{% endstep %}

{% step %}

#### Confirm the type and instances in Management Dashboard

After a successful run:

* Open **Custom Entities** and confirm that type `AUTO_VENDOR` exists
* Open the related mixin schema and confirm attributes for the mapped columns
* Open **Custom Instances** for `AUTO_VENDOR` and confirm the five vendor records

<figure><img src="https://2637457592-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9VS91qn3Ylwd58YivX1A%2Fuploads%2Fgit-blob-ea3a920feef8396666d01e374484aca924661054%2Fit_auto_custom_entity.png?alt=media" alt="Custom Entities list showing AUTO_VENDOR after the first import"><figcaption><p>Custom entity type created by the first import</p></figcaption></figure>

<figure><img src="https://2637457592-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9VS91qn3Ylwd58YivX1A%2Fuploads%2Fgit-blob-acf3084d1c890beedca1f2823af7eae6faca230a%2Fit_auto_mixin_schema.png?alt=media" alt="Mixin Schemas list with AUTO_VENDOR schema expanded"><figcaption><p>Mixin schema created from the mapped CSV columns</p></figcaption></figure>

<figure><img src="https://2637457592-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9VS91qn3Ylwd58YivX1A%2Fuploads%2Fgit-blob-145be4784867b7fd40d99f0b37a4708234bdb1c8%2Fit_auto_custom_instance.png?alt=media" alt="Custom Instances list for AUTO_VENDOR with five imported vendor records"><figcaption><p>Imported AUTO_VENDOR instances in Management Dashboard</p></figcaption></figure>

The first import creates the custom entity type and mixin schema from the mapping. Later runs upsert instances into that type.
{% endstep %}
{% endstepper %}

{% hint style="success" %}
For product, category assignment, and product availability data from one file, see [Importing Products from CSV](https://developer.emporix.io/import-tool/import-configuration-examples/importing-to-multiple-entities.md). For a CSV import into a type you already created, see [Importing Using CSV](https://developer.emporix.io/import-tool/import-configuration-examples/csv-example.md).
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developer.emporix.io/import-tool/import-configuration-examples/auto-mapping-custom-entities.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
