Repeating Rows

How to use a repeating rows pattern to create sections for lists of items that can be added or removed.
Written by Nick Laughton
Updated 1 year ago

Sometimes your forms may need to capture information for one ore more items.  For example, a list of all the authorized drivers for a rental car would have at least one driver, but might have two or three authorized drivers.  Other lists might be entirely optional and not need to display the entry fields for the list unless applicable for the submitter.

To setup this pattern, we will need a repeating section to contain the fields that will comprise each row and we will need a button to add an item to the list.  

First, let's look at our repeating row Section.  In this example, we're going to use a payment schedule list.  Each row of the list will show things like due date, payment method and amount. A row in a list like this will also need a Delete button. 

I've added a Section called "Schedules."  Notice that it is plural, which suggests it is a list.  

In the Schedules section, the binding is set to "schedules" which is the name of the item in our Information Tree. Remember that it is a list, which means the item contains additional sub-items.  

If you want to start the list with at least one row showing, you need to populate the parent section's Initialize Action with the instructions needed to add an item.  For our example, schedules is the name of our list in the information tree.  So we would need to populate the parent section of our button and repeating row (in this example it is a section called Billing Method) with the commands Add Item To List listname.  Our list is called "schedules" so the parent section looks like this:

We need a button to add items to the list.  This is accomplished by adding an Icon-Button and then assigning the appropriate Click Actions.  

In the form, it will display the "+" in our section to allow additional rows to be added.

Inside our repeating row section (Schedules) we have all of our items that need to repeat, and a Delete button.  

The Delete button is in the Common library, but if you need to craft a custom one for any reason, be sure that the Click Action of the button is defined as "Remove Item." You don't need to specify what you're removing. The button will be aware of its context within a repeating row. 

Did this answer your question?