In this post we will discuss how we can add auto number to repeating table rows in infopath 2010. It is like adding a serial number field into the repeating table rows. You can chekc the below articles before reading this:
For this add a repeating table to the infopath form. By default the fields will come as the textbox field. So change the particular fields on which you want the auto number to come. Right click on the field -> Change Control -> Calculated value as shown the figure below:
Then double click on the field and from the ribbon click on Default value from the Properties tab as shown in the figure below:
The above step will open the Field or Group Properties, from the Data tab click on the fx button on the Default value textbox as shown in the fig below:
Then in the Insert Formula dialog box write the below formula and click on verify formula to check wether the formula contains any error or not. Remember to check Edit XPath (advanced) checkbox.
count(../preceding-sibling::*) + 1
The formula should look like below:
Then click on Ok and also click on Ok in the Field or Group Properties dialog box. After you publish the form and you will see the auto number will come like 1,2,3,4,5.... serially for each row as shown in the fig below: