# Importing pre-assembled quantities for assembly BOMs

Set or adjust the pre-assembled stock of many assembly BOMs at many locations from one CSV or Excel file.

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

In Assemblified, **Import quantities from CSV/XLSX** records the <Term def="pre-assembled">pre-assembled</Term> stock of
many assembly BOMs at once: a stock take of the built units on your shelves, a batch that came back
from a contractor, a correction across several locations. One row per assembly BOM and location, one
review, and one apply.

You reach it from **Assembly BOMs**: **More actions → Import quantities from CSV/XLSX** in the title
bar. The dialog that opens is titled **Import pre-assembled quantities from a spreadsheet**.

This import only changes pre-assembled stock. It does not touch BOMs, prices or the two behaviour
settings; those come from the other spreadsheet import, described in
[Creating an assembly BOM](/features/sub-assemblies/creating/#creating-many-at-once-from-a-spreadsheet).

## On this page

- The four steps
- The columns
- Set or adjust
- The review
- If the lookup or the apply stops
- When a row is refused
- Saved mappings
- Common gotchas

## The four steps

<Steps>

1. **Upload.** Pick a CSV or XLSX file. The file is read in your browser. If you do not have one yet,
   the dialog offers a template with the expected headers already in place.

2. **Map the columns.** Tell the dialog which of your columns is which. Your headings do not have to
   match ours: common spellings (*Assembly SKU*, *Qty*, *Adjust By*, *Standort*, and so on) are matched
   for you, and you can change any of them.

3. **Review.** Assemblified looks up each assembly BOM and location, reads the pre-assembled quantity
   there right now, and shows you current → resulting for every row before anything is written. See
   [The review](#the-review).

4. **Apply.** The ready rows are written in batches. The final screen says how many pre-assembled
   shelves were set, and names every row that could not be, with why.

</Steps>

## The columns

Every row is **one assembly BOM at one location**, and **one change** to it.

| Column | Required | Blank means |
|---|---|---|
| **Sub-Assembly ID**, **Sub-Assembly SKU** or **Sub-Assembly Name** | One of them | Which assembly BOM. When a row fills in more than one, the ID wins, then the SKU, then the name. |
| **Quantity** | One of Quantity or Delta | The number of built units that should be on the shelf. 0 or more. |
| **Delta** | One of Quantity or Delta | The number to add. A negative number removes units. |
| **Location** | No | Your default location. A location name or its ID both work. |

A row needs exactly one of **Quantity** and **Delta**. A row that fills in both is refused rather than
guessed at: pick one. A row that fills in neither is refused too.

To change the same assembly BOM at two locations, give it two rows.

## Set or adjust

- **Quantity** sets a count. `40` makes it forty, whatever it was. Use it for a stock take.
- **Delta** adds to what is there. `+12` adds twelve, `-3` removes three. Use it for a batch you just
  built or units you just took off the shelf.

You can mix the two in one file, row by row.

Assemblified turns every row into the exact number it will set **when you review**, not when you apply:
a Delta row becomes *what is on the shelf now* plus your delta. That way, if a batch has to be sent
again, the shelf lands on the same number instead of moving twice.

<Aside type="caution">
The shelf is read once, at review. If stock moves between the review and the apply (an order consumes
pre-assembled units, a colleague builds a batch), the import does not see it: it sets the number shown
in the review. Apply soon after reviewing, or upload again to re-read the shelf.
</Aside>

## The review

While Assemblified looks everything up you see **Looking up your assembly BOMs, locations and
pre-assembled shelves…** with a step counter. Nothing is written during the lookup.

The review is a table with one line per row of your file, in the file's order:

| Column | Shows |
|---|---|
| **Assembly BOM** | The assembly BOM's name, with the row number of your file under it. |
| **Location** | The location the row writes to. A blank Location shows your default location here. |
| **Change** | **Set to *n*** for a Quantity row, or the delta (**+12**, **−3**) for a Delta row. |
| **Pre-assembled quantity** | The current quantity → the resulting one. |
| **State** | **Ready**, or why the row cannot be written. |

Above the table, badges count the rows: ***n* ready**, ***n* blocked**, and among the ready ones
***n* set** and ***n* adjusted**. Under them the dialog reminds you: *The pre-assembled quantity shown
is as it was when this file was reviewed.* If your file names locations your store does not have, they
are listed (*Unknown locations: … The rows naming them are blocked.*), and if some rows could not be
read from the file at all, the dialog says how many were left out.

A blocked row shows one red badge per reason and is never written:

| Badge | What it means |
|---|---|
| **Assembly BOM not found** | No assembly BOM has that ID, SKU or name. |
| **Unknown location** | Your store has no location by that name or ID. |
| **No default location** | The Location cell is blank and your store has no usable default location: none is set, or the one that is set has been deactivated or deleted. Fill in the location, or choose a default location in **Settings**. |
| **Duplicate row for this assembly BOM and location** | Two rows target the same assembly BOM at the same location. Both are blocked, because neither is clearly the one you meant. Merge them into one row. |
| **Pre-assembled shelf could not be read** | The current pre-assembled quantity could not be loaded, so the result cannot be trusted and nothing is guessed. Remove the row and apply the rest, or upload the file again to read the shelf afresh. |

A row with something wrong as typed shows its error in red in the same column:

| Error | Fix |
|---|---|
| **Name an assembly BOM by ID, SKU or name** | The row names no assembly BOM. Fill in one of the three columns. |
| **Give either a quantity or a delta, not both** | Keep one of Quantity and Delta. |
| **Give a quantity or a delta** | Fill in one of Quantity and Delta. |
| **Quantity must be 0 or greater** | A Quantity cannot be negative. To remove units, use Delta. |

**Goes below zero** is a yellow warning, not a block: a Delta would take the pre-assembled quantity
below zero. Whether it can be written depends on your settings (see
[When a row is refused](#when-a-row-is-refused)).

To go on without the rows that cannot be written, click **Exclude blocked**, or click **Remove** on a
single row. Or fix the file, close the dialog and upload it again. When you are happy, **Apply to *n*
pre-assembled shelves** writes the ready rows; it stays disabled while no row is ready.

## If the lookup or the apply stops

While the lookup or the apply is running, the dialog's main button is **Stop**. Stopping parks the run
where it is; **Resume** carries on from the batch that was next.

If a batch fails (a dropped connection, for example), Assemblified tries it once more on its own. If it
fails again, the run parks: **The lookup did not finish** or **The import did not finish**, with
**Resume** to try the same batch again. During the apply, batches that already finished are not
undone, and a resumed batch never moves a shelf twice (see [Set or adjust](#set-or-adjust)).

**Close** is unavailable while a run is going; stop it first.

## When a row is refused

Each row is written on its own. A row that fails does not stop the others. The final screen says
**_n_ of _m_ pre-assembled shelves set.** and lists every row that could not be set, with the reason
and a code in brackets, for example *… (NEGATIVE_STOCK_REFUSED)*. Common reasons:

- **Below zero with negative stock off.** If **Allow negative inventory in Assemblified calculations**
  is off (**Settings → General**), a row whose result is below zero is refused and that shelf is left as
  it was (`NEGATIVE_STOCK_REFUSED`). See [General settings](/features/settings/general/).
- **The assembly BOM no longer exists.** It was deleted between the review and the apply.

What was already written stays written, and the **Assembly BOMs** list shows the new pre-assembled
quantities once the run ends or you close the dialog. To retry the failed rows, fix them and upload a
file with just those rows.

## Saved mappings

If you upload the same kind of file regularly, save the mapping the first 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. These templates are listed under the import type **Assembly BOM
quantities** in [Settings → Import templates](/features/settings/import-templates/).

## Common gotchas

- **Quantity and Delta are opposites.** A column headed *Adjust by* or *Adjustment* maps to **Delta**; a
  column headed *Qty* or *New quantity* maps to **Quantity**. Check the mapping step before you review:
  "set to 5" and "add 5" are very different numbers.
- **One row per assembly BOM and location.** A second row for the same pair blocks both rows rather
  than adding them up.
- **Blank location means the default location.** If your store has no default location, or the default
  location has been deactivated or deleted, a blank Location blocks the row as **No default location**.
- **Building units is not the same as recording them.** This import moves no component stock. To build
  units and consume their components, use Quick build; see
  [Pre-assembled stock](/features/sub-assemblies/pre-assembled/).

## Where to next

- [Pre-assembled stock](/features/sub-assemblies/pre-assembled/): how the shelf is consumed and adjusted one bill at a time.
- [Creating an assembly BOM](/features/sub-assemblies/creating/): the BOM import, for components, price and behaviour settings.

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