You can in InfoPath autonumber repeating table rows as follows:
- In InfoPath Designer 2010, create a new Blank Form template.
- On the Home tab under the Controls group, click Repeating Table and add a repeating table with 3 columns to the form template.
- Right-click the first field (field1) in the repeating table and choose Change Control and then Calculated Value from the context menu that appears.
- With the first field (field1) still selected, click the Properties tab or double-click field1 to bring forward the Properties tab.
- On the Properties tab under the Properties group, click Default Value.
- On the Field or Group Properties dialog box on the Data tab under the Default Value section, click the formula button behind the Value text box.
- On the Insert Formula dialog box, select the Edit XPath (advanced) check box.
- On the Insert Formula dialog box, type the follow formula into the Formula text box:
count(../preceding-sibling::*) + 1
- On the Insert Formula dialog box, click Verify Formula to ensure that the formula does not contain any errors. Click OK to close the message box that says whether the formula contains or does not contain errors. Correct any errors if necessary.
- On the Insert Formula dialog box, click OK.
- On the Field or Group Properties dialog box, ensure that the Refresh value when formula is recalculated check box is selected, and then click OK.
- Save the InfoPath form template and publish it for example to a SharePoint form library.