Conditional content – filtering rows in a repeat section

With ZumeForms you can use a form to collect a set of data. You do this by making a section on a form into a ‘repeating section’. When the user fills out the form they can add additional sections. For example, you may want the user to enter a number of lines on an invoice template, which each line relating to a sale item.

You can then insert that repeating data into your document template by creating a table. This is done by beginning with a {TableStart:MyRepeat_rpt} command and ending the region with a {TableEnd:MyRepeat_rpt} command. In between these two commands you can insert content, including the content of fields on the form that are included in the repeating section. When the document is assembled, this repeating section will loop around until all the rows of the repeat have been inserted.

However, you can also introduce a filter on the repeating data when it is inserted into your document template.  Say for example you have a field {Choices_cho} that has 3 choices ‘A’, ‘B’ and ‘C’. You can filter the rows of data that are inserted into your document by including the filter in the TableStart command as follows:

{TableStart:MyRepeat_rpt Choices_cho = ‘A’}

When the document is assembled, only the rows of the repeat where the users has selected ‘A’ for Choices_cho will be inserted into the document.

Be sure to include single quotes around the filter.