Design Automation & AILIBRARY/FORUM
Sign in
All postsDriveWorks

Your DriveWorks rules belong in a table, not nested IFs

Lee Herron·Jun 30, 2026·2 min read

Every DriveWorks project reaches the same fork. A rule starts simple — IF material = "Steel" THEN... — and then reality shows up. Now there's grade. Now there's thickness. Now there's a customer-specific exception. Six months later that rule is a nested IF you're afraid to touch.

There's a better default: drive the logic off a table.

Why nested IFs rot

Nested logic fails for boring, predictable reasons:

  • Only the author can edit it. The person who knows the business — which grade goes with which finish — can't change the rule without learning your formula syntax.
  • It hides its own gaps. A missing branch doesn't error; it silently returns the wrong thing.
  • It doesn't diff. Change one branch and a reviewer can't tell what actually moved.

The table version

Put the decision in a data table: one row per valid combination, columns for the inputs, columns for the outputs.

material grade thickness finish price_band
Steel S275 6mm Mill A
Steel S355 8mm Galv B
Alu 6082 10mm Anodised C

The rule collapses to a single lookup: find the row that matches the current selections, return the column you need. Add a product line and you add a row — no logic changes, no fear.

Filter the next control off the last

The same table earns its keep on the form. Filter each control's options by what's already selected: pick a material, and the grade list narrows to grades that exist for it. The user can't build an invalid combination because you never offer one.

Cache the filtered set so the form isn't re-querying on every keystroke, and it stays snappy even on big tables.

When nested IFs are still fine

Two or three branches that will never grow? Leave them. The table pays off when logic is wide — many combinations, edited by non-developers, changing over time. That's most quoting logic, which is exactly why it's the default worth reaching for.

If you've already got a nested-IF monster, you don't have to untangle it by hand. The rules-logic-explainer skill in the marketplace will read the block and propose the table form for you — it turned an afternoon of squinting into a coffee's worth of review for us.

#driveworks#rules#maintainability
Download the demo files2 files · 666 B · zipGet zip →

Get new posts by email

Occasional field notes on design automation and AI. No spam.

Keep reading

AI QuotingFrom RFQ to priced quote in one passMost quoting time isn't spent pricing — it's spent turning a messy RFQ into something a ruMCPGiving your AI agent hands in SOLIDWORKSA chatbot that can talk about CAD is a novelty. An agent that can open the model, change a
Your DriveWorks rules belong in a table, not nested IFs — Blog