Hi @Michael_Bartholomew
!
I’ve created a sample based on your description
. (You’ll find it below)
But first, the explanations
.
In my sample, this is done with the very first button named Copy_Button.
Its Action formula is this one :
[Example Table].FormulaMap(
RunActions(
ModifyRows(
CurrentValue,
B,CurrentValue.A
)
)
)
And what it does is :
It takes the table [Example Table] and for each row in the table (FormulaMap()) it runs this action (RunActions())
ModifyRows() :
- 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 withinCurrentValue. Each very specific value in your columnC(for example) is stored asCurrentValue.Cwhich Coda would display as justCin a formula) - The column to modify is the column
B(CurrentValue.B)
In other words, each specific value in the columnB - The new column value is
CurrentValue.A
I.e.: Each specific value in the “list of all rows” in the columnA
Now for the buttons 2 and 3, they work in a similar way as the button 1 does
…
It can be done, but you’ll need to set up your Button 3 before the Button 2 in order to use it in the Action formula of the Button 2.
In the Button 3 (named Clear_Button in my sample) the Action formula looks like this :
[Example Table].FormulaMap(
RunActions(
ModifyRows(
CurrentValue,
B,""
)
)
)
Kind of the same as the Button 1 but this time, it acts on B (CurrentValue.B) and replace each specific value in the column B by "" (Blank)
.
And for the Button 2 (named Sum_Button)
RunActions(
[Example Table].FormulaMap(
RunActions(
ModifyRows(
CurrentValue,
C,C + B
)
)
),
Clear_Button)
This one runs 2 distinctive actions :
- For each row in your table, it sums each specific value in the column
Cand each specific value in the columnB(and the results appear for each row in the columnC)
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
):
