Skip to content
CoEx - Separating Lists into new rows
Share
Explore
Getting Started

How to separate lists into new rows?

How to populate a table row by row from another table?
Background
You get data floating in your table (maybe via an external source, like Shopify below) and as a result you have per row a multitude of data, data you want to have distributed over rows (one item per row). The solution in this template is partly based on one I solved in the , partly because I solved it for in a table, while I was working on a solution that works via a button outside that table, that is the second solution.
image.png
The above is not what you want, you are looking for something like below:
image.png
Two Solutions
In this template I worked out two solutions. One with a button in each row and one with a single button outside the table. The latter is difficult, requires a deep understanding of how lists in Coda are composed and is often not required in most situations, I added it mainly to show the power of the Coda logic and as learning for myself.
Solution 1 - buttons in the rows
We add a button at the end of the table on each row and link it to an other table. We treat each list as a combination of items we will split and distribute in the target table. First what happens in a video of 7 seconds if you do not set up the function properly. I show because it could be very well you came across the same issue. On the pages where I explain the functions, I’ll show the logic behind this error. The purple button pushes all the buttons in the table. It looks like one button, but it is one plus many (in the table).
Splitting a row goes wrong.mp4
Splitting a row goes wrong.mp4
526.8 kB
Create New Rows
Clear Table
10
Source
0
Search
ID
volume
the list
names
button
Total items
1
1
01,02,03,04
item01,item02,item03,item04
Adam,Anton,Ary,Alfred
Click me
10
2
2
AA,BB
item05,item06
Nathan,Louison
Click me
10
3
3
abc,def,ghi
item07,item08,item09
Robert,Richard,Lars
Click me
10
4
4
xY
item10,
Christiaan
Click me
10
There are no rows in this table
Target
0
ID
volume
the list
names
1
1
01
item01
Adam
2
1
02
item02
Anton
3
1
03
item03
Ary
4
1
04
item04
Alfred
5
2
AA
item05
Nathan
6
2
BB
item06
Louison
7
3
abc
item07
Robert
8
3
def
item08
Richard
9
3
ghi
item09
Lars
10
4
xY
item10
Christiaan
There are no rows in this table
Solution 2 - the all in one button outside the tabel
This solution is gracious, efficient but also superfluous in this particular Shopify case. I created it nevertheless to develop elements I may need in other applications that are a kind of standard in comparable situations: you operate on a table via button outside that table (on the canvas or in an other table). As you open the button, you see that it contains quite some code and all parts work together to distribute the data over the relevant rows.

Single Button outside Table
Clear Table
10


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.