Sitemap
simplify your coda formulas

Member-only story

Are your formulas working too hard?

How I replaced a slow, multi-step loop with a single, elegant command

4 min readJun 17, 2025

--

Even after years of building in

, I still have moments where I over-engineer a solution. My recent task was a simple SKU lookup between two tables. My logic for what needed to happen was correct, but my initial formula for how to do it was suboptimal. I built a system to count my rows and loop through them by their number, completely forgetting that Coda’s ForEach() lets you iterate directly over the list itself. It was a perfect reminder that the simplest solution is usually the right one.

Before we get to the clean solution, I think it’s valuable to examine where I started. Here is the initial, working but suboptimal, setup I built to link the [My Products] table to [All Products].

[My Products].Filter(Sku.IsNotBlank()).WithName(record,
Sequence(1,record.Count()).ForEach(CurrentValue.WithName(nbr,

[All Products].Filter(SKU.Nth(nbr).Contains(record.Sku)).WithName(existingSKU,

If(existingSKU.IsNotBlank(),

existingSKU.Nth(nbr).ModifyRows(
[All Products].name,record.Nth(nbr).Name,
[All Products].desciption,record.Nth(nbr).Description),

[All Products].AddRow(
[All Products].name,record.Nth(nbr).Name,
[All…

--

--

Christiaan Huizer
Christiaan Huizer

Written by Christiaan Huizer

I write every week about how to Coda . You find blogs for beginners and experienced makers. Until 7 days after publication you read my blog for free. Welcome!

Responses (1)