Hi, I’m very new to Coda and not yet sure how button formulas work (or most formulas for that matter ). Any help would be much appreciated
I want three buttons sitting above the table in the doc to do the following:
Press Button 1
the values in column B are updated to equal the values in column A. For example if I press Button 1, column B would update to show the value 5 where the value of column A was also 5
however, because Button 1 performs the action and thus column B does not have a formula itself, I could subsequently update the values in column B manually if I want to. For example I could change the value in column B from 5 to 7
Press Button 2
the values in column C are updated to equal their current value + the current value of column B. For example the value in row 1, column C would be equal to 120 + 7 i.e. 127
Press Button 3
clears all values from column B
note: could this Button be automated such that it is pressed automatically once the action from manually pressing Button 2 has been completed?
Does anyone have an example of a table and buttons they’ve created like this I can learn from?
Maybe just a clarification, clicking a button triggers and Action. That Action can execute a Formula.
You can use /button, or a button column, to use the non-coding version where the buttons will each trigger different formulas in the background, using the parameters you entere
d in the pop-up screen.
The row to modify here is represented by CurrentValue
A table is in fact a list of rows and each row in the list of all rows is stored within CurrentValue. Each very specific value in your column C (for example) is stored as CurrentValue.C which Coda would display as just C in a formula)
The column to modify is the column B ( CurrentValue.B)
In other words, each specific value in the column B
The new column value is CurrentValue.A
I.e.: Each specific value in the “list of all rows” in the column A
For each row in your table, it sums each specific value in the column C and each specific value in the column B (and the results appear for each row in the column C)
And then
It pushes the Button 3 (the Clear_Button)
This is not easy to explain (or to understand for that matter )… So, don’t hesitate, if you need more explanations .
In the meantime, I hope this helps !
PS: Oh and there’s a topic I created a while ago which helped me a lot with FormulaMap() (as I was stuck with this one ):
this solution is exactly what I was looking for, so thank you.
I now have a much greater understanding of how formulas work and I previously had no idea about FormulaMap() so this has been an eye opener and a huge help.
I still have a lot to learn but this solution allows me to fulfil my current needs. Thank you for providing such detail.
That is the beauty of Coda, many different ways to do things, so you are always learning.
In a subtle way, @Pch and I solved slightly different problems. One solution is to be able to execute specific single rows, the other to do the calculation for the entire table in a single button press.
Elsewhere i have seen a solution using FormulaMap() that will update rows based on a certain characteristic in another row. I am certain that demo was also done by PcH.