Skip to content

How to check an AI-prepared CSV before a bulk update

7 min read
Operations
How to check an AI-prepared CSV before a bulk update

Key Takeaways

  • 1Compare the file with the approved change list pair by pair: every approved key and value exactly once, no row that was not approved
  • 2Allow only the columns a change needs, because a missing column and a blank cell can behave differently
  • 3Look up how the target system treats blank cells, missing columns and overwrites before the file is built, not after the import
  • 4Run the comparison with a formula or script, not by asking the AI that wrote the file to confirm it

Someone on your team asks an AI assistant to turn a list of approved price changes into an import file, and a minute later a tidy CSV appears. The headers match, the numbers look sensible, and the import button is one click away. The question for an operations or e-commerce lead is whether that file may touch live records, and what you must compare before it does.

The risk is not an obviously broken file. It is a plausible one, so nobody reads every row. This guide sets out a short check for any target system: a pair-by-pair comparison with the approved changes, a fixed list of allowed columns, and a clear rule for what blank, zero and missing mean where the file lands.

Why a plausible file is the dangerous one

A bulk import writes many records in one step, and undoing it usually means another import. A model that builds the file from a list, an old export or a pasted table can fail in ways a skim will not catch:

  • It adds a row you never approved, such as a neighbouring product.
  • It leaves out a row, or repeats one with a different value.
  • It tidies a value: drops leading zeros from a code, rounds a price, or reformats a date.
  • It includes columns from the export it was shown, so the file carries fields that nobody meant to change.

None of this is unique to AI; a person copying between spreadsheets makes the same slips. The difference is speed: the file arrives so fast that review is the only control left, so it must be a check you can complete, not a feeling that the file looks fine.

What the target system does with your file

The same CSV can mean different things in different systems, so find out the rules before the file is generated. Shopify's help centre is a useful example because it states them plainly.

According to Shopify's product CSV documentation, when you import with the option to overwrite products that have matching handles, the values in the file replace the matching values in the store. Three details from that page decide how a "small" file behaves:

  • A blank cell in a non-required column overwrites the existing value with blank. Shopify's own example is a Vendor value that is replaced by nothing when the Vendor cell in the file is empty.
  • A column that is left out of the file leaves the existing values in that column unchanged.
  • Some columns depend on others. Shopify states that including a SKU column without the Option1 name and Option1 value columns deletes the variant option, and that leaving out those two columns creates a new default variant and deletes the existing ones.

Read those together and the lesson is clear: for Shopify, an empty cell and an absent column are opposite instructions. A file that holds every column the AI saw in an export, with blanks where it had no new value, is a file that erases data. Other platforms will differ, so look the behaviour up instead of assuming it.

Spreadsheet software adds a second layer. Microsoft's documentation for opening CSV files in Excel says that Excel interprets each column using its current default data format settings when it opens a .csv file, and that converting a column with leading zeros to text is how you preserve them. If anyone opens the AI's file in Excel and saves it again, product codes such as 00417 may no longer survive, and no one will see the change until the import.

The check: compare pairs, not impressions

The approved change list is the source of truth, not the AI's file. Before anything is generated, make sure that list exists as a plain table with three parts per change: the key that identifies the record (SKU, handle, customer ID), the field to change, and the new value. Then compare in both directions.

  1. Every approved pair appears exactly once. For each key and field on the list, the file must hold the approved value, not a close one, and must hold it once.
  2. Nothing appears that was not approved. Count the rows and the key and field combinations in the file. Any pair that is not on the list is a failure, however sensible it looks.
  3. Nothing is silently altered. Compare codes and identifiers as text, character for character, so a lost leading zero or a trimmed space shows up as a mismatch.

A small illustration. Suppose the approved list holds 40 price changes and the file has 41 rows. A review that only asks whether the prices look reasonable will pass it, while the comparison fails it at once, because one pair is in the file and not on the list. The same method catches 40 rows with one approved key missing and another listed twice.

Do this comparison with a lookup formula, a short script or a database query, and keep its output with the approval. Do not ask the assistant that wrote the file to confirm that it matches; a check by the same tool is not an independent check. Because the check is mechanical, a developer builds the comparison once and the team reuses it. Our article on moving data from a spreadsheet into an internal tool covers the test import and rollback steps that sit around this check.

Fix the columns before you check the values

Most of the damage in the Shopify example above comes from columns that nobody meant to touch. So decide the column list first, and treat it as an allowlist: the key column or columns, plus the one or two fields the change really needs. Everything else is removed from the file, not left blank.

Then write down, for the target system, what each of these states does:

State in the file What to find out Why it matters
Blank cell Does it leave the value alone, or set it to empty? In Shopify's documented behaviour it sets it to empty for non-required columns
Zero Is it a real value, such as a price of 0 or a stock count of 0? A zero can mean "free" or "out of stock", which are real business states
Column absent Does the system keep the existing values? Shopify keeps them, unless another column depends on the missing one

If the documentation does not answer one of these, test it on a staging copy or on two harmless records before the real run, and write down the result. The answer belongs in the task description you give the AI too: "include only these columns, never write blanks, never write zero unless the approved list says zero." The instruction does not replace the check, but it should reduce how often the check fails.

When this check does not fit, and what stays uncertain

The pairwise check suits changes to existing records driven by an approved list. It helps less when the import creates new records from scratch, because there is no list of existing keys to compare with. In that case validate the required fields and formats instead, as in our guide to required fields and simple validation. For a handful of changes, typing them directly into the system is faster and safer than building any file.

Two uncertainties remain. The Shopify and Microsoft pages quoted here describe their products as of this writing, and import rules do change, so re-read the vendor page for the system you actually use. And the check proves that the file matches the approved list; it does not prove the list is right. Someone with authority over prices, stock or customer data still has to approve the list itself.

Your next step

Pick one recurring bulk update your team now prepares with AI, such as a weekly price or stock change. This week, write down its approved list format, its allowed columns, and the blank, zero and missing-column rules of the target system. Then build the pair comparison once and make a passing result a condition of the import. If the data is spreadsheet-based, our rules for business-critical spreadsheets is a good place to start tightening the source. If you want help building the comparison and the guardrails into your own tools, our AI consulting service is where to begin.

Sources

Share this article

Need expert guidance?

Let's discuss how our experience can help solve your biggest challenges.