Add rows from one table to another


Goal: Have a button that adds every row from “From” to table “To”
Thanks to Christiaan Huizer for this solution🙌
Add rows from table "from" to table "to"

From
0
Name
Category
Amount
1
Hector
Legal
10
2
Ana
Finance
5
3
Lucia
Legal
15
4
Other
Legal
1
5
then
Finance
1
6
Ana
Finance
1
7
c
Sales
1
There are no rows in this table

To
0
Name
Category
Amount
There are no rows in this table


How the formula works:


Sequence(1, From.Count()) // create virtual index
.FormulaMap( / iterate over each number in this index
To
.addrow( add row
[Table 2].Name,
From.Name.Nth(CurrentValue), // take the list of values in the column and
put each item on the row corresponding
with number from virtual index
[Table 2].Category,
From.Category.Nth(CurrentValue),
[Table 2].Amount,
From.Amount.Nth(CurrentValue)
)
)
Categories
0
Category
1
Finance
2
Legal
3
Sales
There are no rows in this table


Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.