# Importing materials

Upload a CSV or XLSX of materials, map its columns to Assemblified's fields, review what would be created or updated, then commit it in one go.

import { Steps, Aside } from '@astrojs/starlight/components';
import DocUpdated from '~/components/DocUpdated.astro';

When a supplier sends you a spreadsheet, or you are setting a store up from scratch, Assemblified's importer
turns a file into materials. It takes **CSV, XLS or XLSX** up to **20 MB**, lets you say which of
your columns means what, shows you exactly what it would do, and only then writes anything.

Materials created this way are [virtual materials](/features/raw-materials/virtual-materials/) —
Assemblified owns their stock, because a spreadsheet row has no Shopify variant behind it. To bring
in materials that *are* Shopify variants, use
[Add from Shopify](/features/raw-materials/shopify-linked/) instead. A file can still
update materials you already have, Shopify products included.

Stock is kept per location, so the file's quantities are booked at one location you pick on the
review step, and each material's total follows from its locations. Each new material is saved
together with its opening stock there. Assemblified checks your Shopify locations first; if that
check fails or there are no locations, the new material is not saved.

## On this page

- The four steps
- The columns
- Mapping your file to them
- The review step
- Where the quantities go
- Saved mappings
- Common gotchas

## The four steps

<Steps>

1. **Upload.** Go to **Materials → More actions → Import from CSV/XLSX**. Drag a file in or
   browse for one. If you do not have one yet, the dialog offers a **CSV template** and an **XLSX
   template** with the expected headers already in place.
2. **Map columns.** Assemblified matches what it recognises automatically and shows you the rest.
   Point each of its fields at one of your columns, or skip it.
3. **Preview and validate.** Every row is checked against the mapping. You get a count of valid and
   invalid rows, a preview of the good ones, and a list of the bad ones with the reason for each.
   Invalid rows are skipped, never guessed at.
4. **Review the import.** The last step is the one that knows about your existing materials: which
   rows already match something you have, what should happen to those, at which location the
   quantities are booked, and whether unknown units may be created. Confirm, and it writes.

</Steps>

Nothing is written until you confirm on the last step.

## The columns

| Column | Required | Notes |
|---|---|---|
| **Product Name** | Yes | Rows sharing a product name become variants of one product. |
| **Variant Name** | Yes | |
| **Unit Cost** | No | A number, 0 or more. Blank counts as 0. |
| **Unit Price** | No | A number, 0 or more. Blank counts as 0. |
| **Unit** | Yes | A unit symbol, at most 16 characters. Must exist, or be created during the import. |
| **Initial Inventory** | No | A number: stock at one location, not the total, booked at the location you pick on the review step. Blank leaves an existing material's stock unchanged; a new material then starts with no stock. |
| **SKU** | No | Kept as text, so `123-4` stays `123-4`. |
| **Vendor** | No | |
| **Product Type** | No | Leave the column out entirely and an update keeps what is already stored. |
| **Category** | No | Same. |
| **Specifications** | No | Free-form notes. |
| **Image URL** | No | |
| **Weight** | No | A number, 0 or more. Needs a Weight Unit. |
| **Weight Unit** | No | Must already be an **active** unit in the Weight category. See [Weight](/features/raw-materials/weight/). |

The downloadable template writes these headers in this order.

## Mapping your file to them

Your file does not have to use those headings. The mapping step shows one row per Assemblified field
with a dropdown of your file's columns, and marks each one **Mapped**, **Not mapped** or
**Required**. A required field left unmapped is called out before you can continue. The
**Initial Inventory** field says *Stock at one location, not the total. You pick the location in the last step.*

Common alternative spellings are recognised for you — `Cost`, `Purchase Price`, `Einkaufspreis` for
Unit Cost, and so on — as are the older templates whose required headers ended in `*`.

Two format settings sit above the mapping, because a spreadsheet is ambiguous about both:

- **Number format** — `US (1,234.56)` or `EU (1.234,56)`.
- **Date format** — not used by the material columns, but offered by the same wizard.

If your file has two columns with the same heading, the importer says so and maps only the first.

## The review step

This is where the importer compares your rows with what you already have. Rows are matched on
**product name plus variant name**, and the badges at the top count them: how many rows the file
has, how many are ready, how many have errors, how many already exist, and how many would be created
or updated.

**Materials that already exist** is the decision:

| Option | What happens |
|---|---|
| **Create new only (skip existing)** | Rows that match something you have are left alone. |
| **Update existing only** | Only the matching rows are written; new ones are ignored. |
| **Create new and update existing** | Both. New materials are created first, then the updates applied. |

What happens to the quantities in the file is set in the **Stock location** section, described
[below](#where-the-quantities-go).

**Create missing units of measure during import** appears when your file uses unit symbols
Assemblified does not know. It names them, and turning it on creates them as custom units before the
materials are saved — so you do not have to abandon the upload to go and add them by hand. Weight
units are **never** created this way: an unknown Weight Unit fails the row, and you add it under
[Settings → Units](/features/raw-materials/units/) first.

<Aside type="caution">
Changing the **Unit** on a material that BOMs already use is a real unit change, not a relabel.
The unit changes apply all-or-nothing: every affected material that has a usable conversion is
converted, and if any one of them does not have a conversion the updates are refused.
Materials or custom units already created earlier in the import are kept. Define the missing
[conversion](/features/raw-materials/unit-conversions/) and review those results before trying again.
</Aside>

When you confirm, the button says exactly what it will do: *Create 40 materials*, *Update 12
materials*, *Process 52 materials*. When everything went through, the dialog closes and confirms the
counts. Otherwise the review stays open with the counts, says *Stock was changed at Main warehouse*
when stock changed there, and names any rows that could not be processed rather than silently
dropping them.

An import can save some materials while other rows fail. **Create new and update existing** also
creates new materials before applying updates; a later update failure does not undo those creations.
The review keeps confirmed creation counts and any errors visible. The retry action sends only
new-material rows whose refusal was confirmed; it does not repeat already created rows or attempted
updates. Warnings about connected apps stay available for review without creating those materials again.
Confirmed updates stay recorded while you retry refused new-material rows. If a new-material row
now refers to an existing material, the importer leaves that material unchanged and asks you to
review its opening stock before treating the row as complete.
If an error interrupts the import or its outcome cannot be confirmed, check **Materials** and the
opening stock of any new materials before repeating it. Repeating the whole file can create
duplicates or add the file's quantities to stock a second time.

## Where the quantities go

When at least one row has a quantity, the review step shows a **Stock location** section, the last
one before the buttons, with one choice, **Book quantities at**: every quantity in the file is booked
at that location. Your [default location](/getting-started/initial-setup/#default-location)
is preselected and marked *(default)*; with no default location set, nothing is preselected and you
pick one before you can confirm. If the locations cannot be loaded, the section says so and offers
**Try again**. As the section says: *Stock is kept per location. The file's quantities are booked
at this location only. A material's total is the sum of its locations and can't be set directly.*

- **New materials** start with the file's quantity at that location.
- **Materials that already exist** get a choice of their own, **Quantity for materials that already
  exist**, naming the location:
  - **Replace stock at Main warehouse with the file's quantity** sets the stock there to the number
    in the file.
  - **Add the file's quantity to stock at Main warehouse** adds the number to what is there.
- **Rows with an empty quantity leave stock unchanged.** Their other fields are still imported.
- **A material named twice in the file** keeps the last row's quantity.

The other locations of a material are never touched, and its total always follows from its
locations: there is no way to set a total directly.

### Shopify products in the file

A row can match a material that is a Shopify product. Its stock lives in Shopify, so a quantity on
that row changes Shopify's stock at the chosen location. The section warns about it (*3 of these
materials are Shopify products. Their stock at Main warehouse changes in Shopify.*) and lists them,
and **Confirm** stays unavailable until you tick **I understand that Shopify stock at Main warehouse
changes**, right above the buttons. Choosing another location clears the tick, so you confirm again
for the new one.

On **Confirm**, before anything is written, Assemblified checks with Shopify that each of those
products can take stock at the chosen location. For a product that is not stocked there, you
choose **Activate at this location** or **Skip this item**:

- An activated product gets its stock change like any other row.
- A skipped product keeps its stock as it is, but its other fields are still imported, and the
  result names it.
- A product that no longer exists in Shopify, or that Shopify could not confirm, cannot take the
  stock change and keeps its stock the same way.
- **Cancel** in the check imports nothing; the review stays as it was.

The check's button names the same count as the review's, for example **Process 52 materials**: a
product whose stock change is skipped is still imported.

Virtual materials do not go through this check: their stock is Assemblified's own.

### What the result shows

After the import, a stock change that did not land is never dropped silently. The result says
*Stock at Main warehouse was not changed for 2 rows. Each one is listed below with the reason.*, and
lists each row with its number, product and variant — for example *Row 12 · Oak board · 20 mm:
Skipped in the Shopify check.* If the updates to existing materials are refused as a whole, no
stock is changed either: fix the file and import it again.

## Saved mappings

If the same supplier sends you the same shape of file every month, you do not have to re-map it each
time. On the mapping step, tick **Save mapping as template** and give it a name. Next time, pick it
from **Pre-load a saved mapping** on the upload step and the mapping is filled in for you.

Saved mappings belong to this import type, and you manage them under **Settings → Import templates**.
A template that refers to a field that no longer exists loses that entry and tells you so.

## Common gotchas

- **A missing product or variant name.** The column is not mapped, or the cell is empty. Both are
  required on every row, and the message names the one that is missing.
- **A unit symbol your store does not have.** The row fails unless you turn on **Create missing units
  of measure during import**, or add the symbol under Settings → Units first. The message lists the
  built-in symbols.
- **A weight unit your store does not have.** Weight units are never created automatically. Add it in
  the **Weight** category first.
- **A number that does not read as a number.** Usually the number format: a file written with
  `1.234,56` needs the **EU** setting.
- **No valid rows at all.** Check the mapping and the value formats before touching the file — the
  wizard lets you go **Back** and change the mapping without re-uploading.
- **Stock that did not change.** A blank quantity leaves an existing material's stock as it is, and
  a quantity is booked at the chosen location only, never as a total. Check the location the review
  step named, and the rows the result lists.
- **An export's Total stock column is not imported.** A file from
  [Export](/features/raw-materials/materials-list/) carries each material's total under
  **Total stock (all locations)**, and the importer leaves that column out, so importing the file
  changes no stock. To update stock from a file, export with a location filter and map that
  location's **Available at** column to Initial Inventory at the same location, or fill an
  **Initial Inventory** column.
- **Warnings are not errors.** Zero cost, zero price, no SKU, no vendor, a price below cost and a SKU
  that repeats inside the file are all flagged but still imported.

## Where to next

- [Virtual materials](/features/raw-materials/virtual-materials/) — what an imported material is, and how to create one by hand.
- [Units of Measurement](/features/raw-materials/units/) — the unit field, and creating units.
- [Weight](/features/raw-materials/weight/) — the two weight columns and why weight units are stricter.
- [Adjusting stock and stock counts](/features/raw-materials/restocking/) — the other upload, for changing quantities rather than materials.

<DocUpdated date="2026-11-20" />