cancel
Showing results for 
Search instead for 
Did you mean: 
kovinis
Nintex Newbie

Auto-increment repeating section line number

Jump to solution

Hello to all, 

Today I was given a task  - to create form with repeating section and set lines number in section, that when I closed form and open a new one, the first row of the repeating section should have previouslyNumber+1 value:

E.x:

110 - myinfomation.  and I close the form.

Open a new one and the first row should look like:

111 - another information.

And so one. Maybe someone has already done this or have ideas?

For now, i'm thinking about reading all lines and counting it, and display the number in first row.. but not have ideas what to do about the remaining rows..  

Reply
6 Replies
Automation Master
Automation Master

Re: Auto-increment repeating section line number

Jump to solution

Hi ,

Could you explain the reason behind such requirement. Are the two items related. Once you close the form and create a new one, the repeating section starts afresh. You may have to work with xml or update a property on the item to the number of rows.

There is currentRownumber function that can be used to increment the rows for repeating table. See other references here to count the number of rows:

Auto increament column in a repeating section 

How to count dynamically the number of items in repeating section ? 

Count of repeating section 

Reply
kovinis
Nintex Newbie

Re: Auto-increment repeating section line number

Jump to solution

Hi ‌,

the reason why I need this solution is for archive. 

When I open a new form I need to know the latest number of row because every number show's folder name. It's like archive with unique number. 

0 Kudos
Reply
Highlighted
Automation Master
Automation Master

Re: Auto-increment repeating section line number

Jump to solution

sharepoint does'nt provide anything like a global sequencer.

but I remember I came across a suggestion once to read such a sequence number from remote source like database.

For now, i'm thinking about reading all lines and counting it, and display the number in first row.. but not have ideas what to do about the remaining rows..

that will not ensure unique numbering if two or more people will be about to add new item to a list - you will not see items just being populated and hence give them the same numbering.

if you anyway decide to go that way, you can use number of line as starter value and add up currentRowNumber() value

Reply
kovinis
Nintex Newbie

Re: Auto-increment repeating section line number

Jump to solution

Hey ‌, 

Thank you for your advice.

For my problem, I could not find a way to deal with it, so I just simply build a workflow to count row's and every time I add row's number to static number  and so on.

Thank you all for advice!

View solution in original post

0 Kudos
Reply
anthonynhn999
Nintex Newbie

Re: Auto-increment repeating section line number

Jump to solution

To create a unique ID for each row in a repeater, you can make use of the calculated value with the following rule:

1. Use IF condition to test if this calculated value isNullorEmpty

2. IF it is null (first time), assign the value in the format "currentRowNumber() + DateTime(yyyy-MM-dd-hh-mm-ss)"

3. IF it is not null (second time), re-assign the same value (using the Named Control of the calculated value).

Then, you will have a unique string or number for each row in a specific repeater.

Cheers.

0 Kudos
Reply
Automation Master
Automation Master

Re: Auto-increment repeating section line number

Jump to solution

hmm, have you ever tried to implement anything like this?

nintex doesn't support formulas with circular references, so you cannot get/test  the value of named control within its own formula    

and I'd doubt about uniqueness as well.

let's imagine one creates 3 repeater rows within a second. they'll get identifiers like 1DateX, 2DateX, 3DateX.

let's assume each rows described (eg) different event, like

1DateX = eventA

2DateX = eventB

3DateX = eventC

now I delete 2nd row for any reasons. suddenly I do get

1DateX = eventA

2DateX = eventC

so suddenly likely to be 'unique identifier" represent totally different data. 

this is definitely not what I'd like to have as a unique identifier...

0 Kudos
Reply