Websites

Import products from CSV with a preview before anything is added

To import products from CSV, you match a spreadsheet's columns to your product fields and add the rows in one go. On OneCraft the agent writes the importer into your site's admin with the csv guide: pick a file, see the first 50 rows with problems marked, then insert them in batches, and export any admin table the same way.

Create a website with OneCraftHow the importer reads and maps a file, how to prepare a file from another shop, the export button on every admin table and the rules an import cannot skip.

How the import works

The file is read in your browser, including quoted commas and line breaks. Each header is matched to a column of the table by name, with letter case and spaces ignored, so a header called Name fills name. A preview shows the first 50 rows with problems in red. Import then inserts rows in batches of 200 and reports how many were created and skipped.

Getting a file from another shop ready

There is no ready made Shopify, WooCommerce or Square import. A file exported from another platform imports when its headers match your columns, so rename them in a spreadsheet first. Prices are stored as whole cents, so a price of 19.95 goes in as 1995. Because the importer is code in your own site, you can also ask in chat to map other headers or convert dollars to cents.

Export from every admin table

Each admin table can carry an Export button. It reads all rows 1,000 at a time and writes a CSV file in your browser, with a byte order mark first so spreadsheets read accented letters. A cell that starts with =, +, - or @ gets a leading apostrophe, so a spreadsheet will not run it as a formula.

Rules an import cannot skip

Rows go in through the same admin rules as the product form: only people in site_admins can insert, and the database refuses everyone else. Rows the database refuses are reported as skipped. An images column can hold web addresses; to keep photos in the site's own storage, upload them in the product form after the import.

How it works, in three steps

  1. Step 1

    Ask for import and export

    Ask for CSV import and export in the generator's brief for a shop, or in chat on a site whose admin already has a products table.

  2. Step 2

    Give it a database

    Every plan gets a hosted site database, or you can connect your own Supabase account in the site's Settings, Database card.

  3. Step 3

    Import in the admin

    Sign in to /admin, choose the file, read the preview and press Import; publish from the builder on a paid plan to run the live shop.

Limits worth knowing

Questions people ask

What should the header row of my product file look like?

Use the column names of your table, such as name, slug, description, price_cents, stock and active. Letter case and spaces are ignored, so Price Cents works too. The preview shows the first 50 rows with any problems in red before anything is inserted, so you can fix the file and choose it again.

Can I import variants from a CSV?

Variants live in their own table, product_variants, linked to a product by its id, so they import as a second file once the products exist. Each row carries the product id, the option values, a price in cents, stock and a SKU. Ask in chat if you want one file to fill both tables; the agent can change the importer.

Will an import overwrite products I already have?

No. The importer inserts new rows; it does not match and update existing ones. A row whose slug already exists breaks the unique rule and is not added. To change many prices at once, export the table, edit it in a spreadsheet and ask in chat for an update by slug, or edit the rows in the admin.

Why does a cell in my export start with an apostrophe?

That is the formula guard. A cell beginning with =, +, - or @ could run as a formula when a spreadsheet opens the file, which is a known way to slip harmful commands into exports. The exporter adds a leading apostrophe so the cell shows as text. Remove it only if you really want a formula there.

Is there a size limit on the CSV file?

The guide sets none. The file is read and parsed in your browser and rows are inserted 200 at a time, so a long file simply takes longer and depends on your computer's memory. Exports read the table 1,000 rows at a time until every row is in the file.

Make your own website

The button opens the generator with this use case already described. Change the wording to match yours, generate, then edit anything you like.

Create a website with OneCraft

Not ready to start? See the AI website builder page first.

Related pages

More finished work of this kind is on the website examples hub.

Sources

Written and checked by the OneCraft team. Last checked .