Ooh, there’s so much more to that!
-
If
/Switch
/SwitchIf
work within actions:If( thisRow.Done, SomeTable.AddRow(...), OtherTable.Filter(...).DeleteRows() )
Use
_Noop()
(no operation) if you only need to do something if the condition is true but nothing if it’s false:If( thisRow.Done, thisRow.DeleteRows(), _Noop() )
-
FormulaMap()
works within actions:Projects.Filter(...).FormulaMap(RunActions( thisRow.ModifyRows([_Current project], CurrentValue), Tasks.Filter(Project = thisRow.[_Current project]).ModifyRows(...) ))
Sequence(1, 10).FormulaMap( Table.AddRow(Index, CurrentValue) )
-
Of course you can combine everything into one huge action, like here:
Complex Coda Docs — Mapping them out for sustainability and continuous development -
Buttons are great replacements for checkboxes where you need them checked/unchecked differently per user — see how starring/unstarring items works in @BenLee’s example here.
Also a thing to know: wrapping your action with RunActions
is not necessary when you’re only performing one instruction (one action or one set of buttons to press). I.e. there’s no need to write
RunActions(
Tasks.[Toggle Done]
)
to press all buttons in a column of Tasks. Simply
Tasks.[Toggle Done]
would work just as well. You only need RunActions()
when you’re declaring two or more actions in a sequence explicitly (i.e. with a comma between).