Hello Lasse,
I believe this possible by combining the “AddRow” and “FormulaMap” functions, see example here:
https://coda.io/d/Untitled_d19OjdM8lW4/Section-1_suxWf#_lug4l
In the example, I mimicked your table, and made the formula for the button as follows:
LeftPad("",[Number of Products]-1,"|").Split("|").FormulaMap(AddRow(SubProduct, SubProduct.Customer, thisRow.Customer, SubProduct.Product, thisRow.Product))
The Leftpad and Split is used to create a list that has the correct number of empty elements. There may be a more elegant way to do this.
The FormulaMap is then used to create a repeater function, so if the number was 3, Coda with then run:
AddRow(SubProduct, SubProduct.Customer, thisRow.Customer, SubProduct.Product, thisRow.Product)
AddRow(SubProduct, SubProduct.Customer, thisRow.Customer, SubProduct.Product, thisRow.Product)
AddRow(SubProduct, SubProduct.Customer, thisRow.Customer, SubProduct.Product, thisRow.Product)
Which I believe is what you are looking for!
Let me know if that works, thanks,
Bobby