For loop for email sender template

I am trying to send the output of an API response into an email body.I am setting the Email type has ‘HTML table’ so that i do not send one email per document but rather one email for multiple documents.

I am trying to use a for loop in the Template,but cant figure out how to do it.Should i use javascript etc?.

The intent is to have an output of an HTML table with multiple rows.

FYI I am using batch size as 1 in the Email sender because i am using an Ultra pipleine.Therefore batching should be turned off.

The output of your API response consists of multiple rows yes? If so, then use the “Group By N” snap in order to group them all into one message by setting the group size to 0. Then use that resultant field in the body of your email.