Repeat Group Entry Grouping Into Separate PDF Tables

In this guide, we will demonstrate how to group repeat entries into separate tables inside a PDF. Each PDF template table will include a specific field from outside the repeat group. You can use the following example form template to import into your Formyoula account:

[Example Form] Repeat Group Number Field Calculation And Grouping On PDF.json11.0KB

We will use the GroupBy template function to group each repeat entry by selected field value.

{{#groupBy [list] by = [property]}}

Example form entry repeat values where we will group entries based on Select List field value:

image

This will result in the following PDF output:

image

PDF Template:

<!-- Group Repeat Items (d042-be15-c265) by Select List (a556-4d0e-7b86) value -->
{{#groupBy d042-be15-c265 by = 'a556-4d0e-7b86'}}
	
	<!-- Value of the grouped list field Select List (a556-4d0e-7b86) -->
	<h1> Group By: {{value}}</h1>
	
	<br>
	
	<table align="left" border="1" cellpadding="1" cellspacing="0" style="width:100%;">
		
		<thead>
			<tr>
				<th> Quantity </th>
				<th> Select List </th>
			</tr>
		</thead>
		
		<!-- Loop over each grouped Repeat Item (d042-be15-c265) -->
		{{#each items}}
		
			<tbody>
				<tr>
					<!-- Repeat Group entry Quantity field (de63-1347-d4a3) -->
					<td> {{de63-1347-d4a3}} </td>
					<!-- Repeat Group entry Select List field (a556-4d0e-7b86) -->
					<td> {{a556-4d0e-7b86}} </td>
				</tr>
			</tbody>

		{{/each}}
		
	</table>
	
	<br><br>
	
	<!-- Check the Group By field value and display a specific field if the value matches -->
	{{#compare value 'Select One' operator = '=='}}
		
		<!-- Display a field from outside the repeat group if the group by value matches -->
		<h3> Show Text IF Select One: {{@root.b1e6-a3f1-9b5c}} </h3>
	
	{{/compare }}
	
	<!-- Check the Group By field value and display a specific field if the value matches -->
	{{#compare value 'Select Two' operator = '=='}}
		
		<!-- Display a field from outside the repeat group if the group by value matches -->
		<h3> Show Text IF Select Two: {{@root.bf22-a643-5ddf}} </h3>
	
	{{/compare }}
	
	<!-- Check the Group By field value and display a specific field if the value matches -->
	{{#compare value 'Select Three' operator = '=='}}
		
		<!-- Display a field from outside the repeat group if the group by value matches -->
		<h3> Show Text IF Select Three: {{@root.150b-2365-ed4d}} </h3>
	
	{{/compare}}
	
	<br><br>

{{/groupBy }}

<!-- Display specific field value outside the repeat group by -->
<h2> Quantity Sum: {{479f-9e40-7187}} </h2>

For any questions, please contact us - [email protected] or the Formyoula in-app chat 🙂