Documentation

Fix Validation Errors


When you have unsaved errors or warnings, Blue Butterfly tells you in three places:

  • Coloured cells — red for errors, yellow for warnings
  • Header counter3 errors · 2 warnings at the top of the spreadsheet
  • Toast notifications — short messages near the cell explaining the issue

This page is the practical guide to clearing them. For the underlying rule reference, see Validation Rules.

Errors block save; warnings don’t

  • Red error — the row will not save until the cell is fixed. The Save button on the Edit Drillhole dialog is disabled while errors exist; cell edits in the spreadsheet are rejected.
  • Yellow warning — the row saves normally. The warning is informational — review it and decide if it’s a real issue or expected for your data.

A row can have any mix of cells in error, warning, or clean states.

Find the issues fast

Click the N errors · M warnings counter in the spreadsheet header. The view scrolls to the first problem cell and highlights it. Press the same counter again to cycle to the next.

You can also scan visually — coloured cells stand out clearly against the white-and-grey grid.

Common cases and how to fix them

Required field is empty

Cell is highlighted red. Fix: type a value. If the column is genuinely optional in your workflow, remove the required rule from that column in Data Tables (or Drillhole Template for collar fields).

Number out of range

A range rule failed (e.g., >= 0 && <= 100). Cell is red. Fix: type a value within range, or — if the bound is wrong for your project — adjust the rule’s condition.

Pattern mismatch

A pattern rule (regex) failed. Common when sample IDs or hole names don’t match an expected format like ^[A-Z]{2}\d{5}$. Fix: correct the value, or relax the pattern in the column’s rules.

Reversed depth interval

The depth-interval rule fires when Depth From ≥ Depth To. Fix: ensure the From value is less than the To value. If you imported data and most rows are like this, the import probably mapped the columns the wrong way around — re-do the import with corrected mapping.

Overlapping intervals

The depth-interval rule also fires when two rows in the same drillhole’s same table cover overlapping depths. Fix: identify which row is the duplicate or out-of-bounds and either delete it or trim its bounds.

Crossing a lithology boundary

If your table has a Lithology source set, intervals that cross a boundary in the linked lithology table are flagged as warnings. Often legitimate (e.g., an alteration zone that genuinely spans two lithologies), so this is a yellow not a red. Fix: if it’s a logging mistake, split the interval into two rows at the boundary; if it’s intentional, the warning is safe to ignore.

Custom expression failed

A custom rule’s mathjs expression returned false. The toast tells you which expression — e.g., recovery <= depth_to - depth_from. Fix the value, or check the rule’s expression for a mistake.

Formula cell shows ERROR

A formula column’s expression failed to evaluate — usually a divide-by-zero, missing referenced column, or syntax error in the expression. Open Templates → Data Tables and check the formula on the column. See Formula Columns for syntax.

Bulk-cleaning after an import

If you import a large CSV and end up with many errors, you have two productive options:

  1. Fix at source. Delete the bad rows in Blue Butterfly, correct the source file, and re-import. Often faster than fixing 200 cells one by one.
  2. Soften the rule temporarily. If you know the issue is cosmetic and want to ship a deliverable, demote the rule from Error to Warning in Templates — the rows will save, you can fix them on a later pass.

Don’t import bad data with rules disabled and forget to re-enable them. Set yourself a reminder.

Why a row won’t save even when nothing looks red

A handful of cases:

  • You’re inside an unconfirmed edit. Press Enter or Tab to confirm the cell first.
  • A formula column shows ERROR. Even though formulas are read-only, an ERROR from a referenced column upstream blocks save. Find the upstream cell and fix it.
  • You’re offline and there’s a stale Pending state. Refresh the page (data is local, not lost). If a row is genuinely stuck, see Troubleshooting & FAQ.

Tip: validation is your friend

It’s tempting to disable rules to “make it work.” Resist. Most rules exist because someone — possibly you — already shipped bad data once. The five seconds you spend fixing a red cell now saves twenty minutes of cleanup before next week’s deliverable.