Simple WHILE Loop in Coda

This is a simple way to create a WHILE loop in Coda.
While-loops are rarely needed, we normally get by with FormulaMap().
But sometimes we need to repeat a formula WHILE some condition is True.

Be careful to ensure the <while-condition> is properly set up so you dont get an infinite loop!
(If it does loop forever, you may have to close the browser, re-open your doc and modify the loop)

This example is trivial - it just keeps adding ‘Step’ to ‘Value’ while it is less than ‘Finish’.
But this pattern will work for any <while-condition> and any set of <loop-actions> you require.



this is a simplified and more compact rendition of an earlier technique posted by @Paul_Danyliuk here…


This is amazing! Incredibly clear brilliant and simple


The real brilliance here is making Repeat a different column so that Loop can call itself.

1 Like