Hello,
We recommend you to do that in two steps:
1. Replace the row with as many rows as you need using the addTemplateVariable method and adding new placeholders instead of the values.
2. Replace the new placeholders with the needed values.
Regards.