How to Auto-number Repeating sections in InfoPath 2010

user1654069 picture user1654069 · Sep 7, 2012 · Viewed 10.8k times · Source

I have several rows in my InfoPath form initially arranged in a table. Afterwhich, I've a repeating section consisting of a single row for the user to enter data row-wise in a repeated fashion. Each row needs indexing, the index starting from the index of the last row in the previous table.

There is no "Expression box" control available in InfoPath 2010 for auto-incrementing as stated by multiple other sources on the web.

I do not need the form to be numbered after submission. I want the ROWS to be auto-numbered while the user enters values under the repeating section while filling the form in the browser.

Is there a way or any work around to this problem? Or, is there any formula that can be used?

Answer

firestream picture firestream · Sep 12, 2012

I can be done using the count function, example:

count(../preceding-sibling::*) + 1

You will need to have a field in your repeating group for the ID, then go to that field's properties and set it's default value to that function using the formula button. You'll then have to edit xpath values to set the value to that function call.