How Automatic Number Repeating Sections in InfoPath 2010

I have several rows in my InfoPath form, originally ordered in a table. After that, I have a repeating section consisting of one line so that the user can enter rows of data sequentially. Each row needs to be indexed, an index starting with the index of the last row in the previous table.

InfoPath 2010 does not have an Expression box control for automatically zooming, as indicated by several other sources on the Internet.

I do not need a form for numbering after sending. I want ROWS to be automatically numbered while the user enters values ​​under the repeating section when filling out the form in the browser.

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

+4
source share
2 answers

I can execute the count function, for example:

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

You will need to have a field in your repeating group for the identifier, then go to these field properties and set its default value for this function using the formula button. Then you will need to change the xpath values ​​to set the value to call this function.

+2
source

Note. I am using InfoPath 2007, so I'm not sure if 100% of this applies to InfoPath 2010

I was looking for something similar, but I just wanted my repeating sections to display a number.

The answer from @firestream almost worked for me, except for some reasons, the first section was not installed. They were numbered as "empty, 2, 3, 4, ..." In addition, I do not need the number to be constant in the data source and not need an additional field.

I just created an Expression Box control and set XPath to count(preceding-sibling::*)+1

+1
source

Source: https://habr.com/ru/post/1432888/


All Articles