How to pre-fill a repeating table in InfoPath with rows of data
Learn how you can add default rows to a repeating table in InfoPath, so that when you open the form, the repeating table already contains a certain amount of rows with data.
You want a repeating table on an InfoPath form to contain a predetermined amount of rows of data when you open the InfoPath form.
Use the Default Values option to prefill the repeating table with a certain amount of rows of data.
You can achieve this functionality as follows:
- In InfoPath, create a new Blank form template.
- On the Insert menu, click Repeating Table.
- On the Insert Repeating Table dialog box, enter the number of columns for the repeating table or accept the default of 3 columns, and click OK.
- On the Tools menu, click Default Values.
- On the Edit Default Values dialog box, expand the group1 node.
On the Edit Default Values dialog box, click the group2 node to select it, click the arrow to the right of the node to display the drop-down menu, and then click Add another group2 below.
Figure 1. Adding a row to a repeating table on the Edit Default Values dialog box in InfoPath.
- Repeat the previous step for as many default rows as you want to add to the repeating table.
Once you're done adding the default rows, click the field1 node under the first group2 node to select it, and enter the data that you want the this field (located in the first column of the first row of the repeating table) to contain in the Default Value text box at the bottom of the Edit Default Values dialog box.
Figure 2. Prefilling a default value for the field located in the first column of the first row of the repeating table in InfoPath.
- Repeat the previous step for each field in each row of the repeating table, which you want to prefill with data.
- Once you're done entering the data for the fields, click OK on the Edit Default Values dialog box.
You should now have a fully functional InfoPath form, so that when you open the form, the repeating table has already been prefilled with rows of data.
Copyright: This article may not be used on web sites (whether personal or otherwise), copied, disseminated, altered, printed, published, broadcasted, or reproduced in any way without an expressed written consent of S.Y.M. Wong-A-Ton. The techniques demonstrated in this article may be used within any Microsoft InfoPath project. This article is provided without any warranties. Copyright for this article is non-transferrable and remains with the author, S.Y.M. Wong-A-Ton.
Related InfoPath Articles:
- InfoPath Basics: Repeating control basics in InfoPath
- What is InfoPath repeating table?
- SharePoint list CRUD operations using an InfoPath repeating table
- Multi-select list box to show/hide columns in horizontal repeating table
- InfoPath sum function to calculate repeating table sum