Photo by Jordan Whitfield on Unsplash

Modify Rows in Coda

Simple & more complex cases

  • check changes
  • update values

Example 01 — Modify this row

We start with an easy example. We modify a row based on a value living in an other row. The code below states that we use the value living in cb_src1 and that we show this value in cb_trgt1. Since this is a checkbox it is either true or false (for details check this blog) we see the box checked or unchecked in the target check box.

basic manipulation

Example 02 — Clear list and set value

The second example clears first all items in the list cb_trgt2 and next does what we showed in the first example. We need two modify ‘row’ functions. The first modifies all items in the list and this possible because we reference ‘thisTable’, while in the second function we have the standard modifyRows. We can only combine both functions using the RunActions(), the function that enables multiple actions.

clear list and modify list

Example 03 — uncheck Or check

This is a rather simple manipulation and highly efficient in case you need it. By applying the function Not() you alter the given state into its opposite.

get the oppossite state

Example 04 — Stock

The last example of this blog is related to keeping track of changing values which partly live already in the column (the list) we manipulate. This is a special since we can calculate with a value living in the target list. In the code below we have two resulst. The first one outputs a list of items, while the second takes the sum of these items.

items in stock

Conclusion

Most of what you need in Coda is possible with these examples. It is very well possible to print highly complex outcomes, but that does not change the Modify logic fundamentally. The above examples you can test in the sample doc.

Coda expert Christiaan on: ”Modify Rows in Coda”

--

--

I use Coda mainly for (HR) planning & (budget) calculations. Follow me to learn how to Coda with numbers. I blog at least once per week.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Christiaan Huizer

I use Coda mainly for (HR) planning & (budget) calculations. Follow me to learn how to Coda with numbers. I blog at least once per week.