JavaScript required
We’re sorry, but Coda doesn’t work properly without JavaScript enabled.
Skip to content
Gallery
Coda template distribute nested values
Template Distribute Nested Values
Nested loops
Prefill a table
More
Share
Explore
Nested loops
Add rows with unique categories and ids + remove orphaned items
The green button:
Adds rows with categories to the target table
Removes rows in the target table when the categorie no longer lives in the source table
this can happen when due to an automation an order gets adapted (out of stock for example)
Removes rows in the source table when there are no categories
Complete Target Table
DB Source
DB Source
1
2
3
4
5
Name
ID
categories
Name
ID
categories
1
1
Duck
Chicken
2
2
Chicken
3
3
Cow
4
4
Sheep
6
5
Sheep
Horse
Chicken
There are no rows in this table
Clear Target Table
DB Target
DB Target
1
2
3
4
5
6
7
8
Name
ID
Category
Name
ID
Category
18
1
Duck
19
1
Chicken
20
2
Chicken
21
3
Cow
22
4
Sheep
25
5
Sheep
26
5
Horse
27
5
Chicken
There are no rows in this table
Categories
Categories
1
2
3
4
5
Name
Name
Duck
Chicken
Horse
Cow
Sheep
There are no rows in this table
DB IDs
DB IDs
1
2
3
4
5
6
Name
Name
1
2
3
4
5
6
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 (
Ctrl
P
) instead.