Back to Feed
article 2m read

Old supplier sheets fed my importer their own error messages as product names

Broken formulas in older supplier intake tabs left missing-data notices and reference errors in the name and cost columns, and my parser took them because they weren't empty; now it picks the first value that actually means something, falls back to other columns, and reads cost by value.

Article DepthPractice

Flow

What the picker checks now

  1. 1Skip error cells

    A code like #REF! or #N/A is not a value

  2. 2Skip notes and footers

    Missing-data notes, subtotals and signature lines don't count

  3. 3Check every same-named column

    A heading can appear more than once, so the first match isn't enough

  4. 4Fall back for names

    Use the source material when the product name is junk

  5. 5Pick cost by value

    First number above zero, wholesale before unit cost

Old supplier sheets were giving my importer their own error messages, and it took them as product names.

The ordering system reads new products from supplier sheets, one row per product. In the older tabs, the name column is a formula. When a column it needs is empty, it doesn't go blank. It writes a note saying data is missing.

How a note became a name

My parser took the built name if anything was there, and made one up only if it was empty. The note wasn't empty, so it won. The real description, a few columns over, was never read. The old tabs also use category headings my parser didn't know.

Cost broke the same way. The unit cost is a formula too, and in old tabs it can show an error. My parser read that first, got nothing usable, and called the row unpriced. The real wholesale price was in the next column.

Treating "something is there" as "there's a value" was a dumb default, and it was mine.

The slot check the old tabs probably hit

Later on, a planner decides if a row is a rotating slot or one fixed product. Vapes and dabs belong in slots. The importer already refuses to run when an old sheet hides those rows from the planner. I'd guess the old tabs hit that wall. That was the right call, but it would have blocked them all.

Teaching the picker what junk looks like

If you build something similar, these are the checks I'd copy:

  • Skip spreadsheet error codes, like a cell that reads #REF! or #N/A.
  • Skip the missing-data note and order footers like subtotals and signature lines.
  • Check every column with the same heading, not just the first one.
  • Fall back to the source material when the name is junk.
  • For cost, take the first number above zero, wholesale first.

The same day I found a cousin. The planner's slot words included "nectar", so one nectar collector got planned as a slot. I took the word out and added a test.

Where the checklist runs out

The parser only sees text, so this list needs upkeep. Nothing marks a row as recovered, either, so a wrong but plausible name looks just like a clean one.

Keep reading

Pick up a connected idea or branch into a nearby one.

5 paths forward