Tag : repeating table

InfoPath – How to clear out a repeating table

On occasion you may wish to clear out a local table completely every time you visit the form, for example when you want the user to enter new details in a table format and do not want previously entered rows to display. Since there is no [easy] method to delete all the rows in the table in the form load (which is where you would most likely want to perform this action), there is a small workaround that allows you to clear out all rows. Here are the steps you need to follow

Add a text field to your form that is the name of the repeating table that you will later create, say ‘TableXXX’ (The table must not have already been defined)


In the ‘Form Load’ section, create an action to set this field to blank as shown below


Delete the field but leave the Action in the Form load

Insert the Repeating Table into your form, configuring the columns as required. Do not concern yourself with changing the group name at this point


Now, right click of parent group (group 5) of the repeating section, select properties and change the name of the field to the name of the field that you previously deleted. When you have completed this, the field layout should be as shown below


Since the previous rule of the text box ‘TableXXX’ remains, you have now tricked InfoPath to clear out this table each time the form opens. If you wish to clear out the table on some other action, create the action on the field and set the temporary text value to empty BEFORE you insert the actual table itself