Fetching multiple rows from a field in generate template plugin

Can we Fetch multiple rows of a field in generate template plugin so that they can be seen in mail , as when i tried to introduce them with input field option given in the plugin it only fetched one row . Can it be done , if yes how ?
Thank you

Yes, this is definitely possible!

The reason Generate Template only fetched one row in your initial attempt is because the Generate Template step processes incoming stream data on a row-by-row basis. For each individual row passing through the pipeline, it generates a single output string. When passed to an email step, it only sees one row at a time.

To display multiple rows of data inside a single email body, you must aggregate the rows into a single field/string before passing the stream into the Generate Template step.

Here are the two standard ways to achieve this in Process Studio:
Method 1: Using the “Group by” Step (Quick Concatenation)

If you want to merge multiple row values into a simple list or line-separated text:

  1. Insert “Group by” Step: Place a Group by step directly before your Generate Template step.
  2. Set Grouping:
    • Group fields table: Leave this completely empty if you want to combine all rows in the dataset into a single record.
  3. Configure Aggregation:
    • Under Aggregates, select your input field in the Subject column.
    • Set Type to Concatenate strings separated by ….
    • In the Value / Separator column, enter <br> (for HTML line breaks) or a comma/newline.
  4. Insert into Generate Template:
    • Double-click your newly aggregated field from the Input Fields list in the Generate Template step to add its placeholder (e.g., ?{aggregated_field}) into your template string.

Method 2: Building an HTML Table (Best for Email Reports)

If you want the multiple rows rendered as a formatted HTML table inside your email:

  1. Format Rows in JavaScript (“Modified Java Script Value” Step): Add a JavaScript step before aggregation to format each incoming row into HTML table row tags:
var row_html = "<tr><td>" + item_name + "</td><td>" + item_status + "</td></tr>";

  1. Combine Rows (“Group by” Step): Add a Group by step after JavaScript:
    • Leave Group fields empty.
    • Under Aggregates, set Subject to row_html and Type to Concatenate strings separated by ….
    • Set the aggregated result field name to table_body.
  2. Embed in “Generate Template”: In your Generate Template step, construct the surrounding HTML table structure and double-click table_body to insert the placeholder