Automatically create IDs in repeating section

  • 14 January 2020
  • 4 replies
  • 22 views

Badge +2

Hello,

 

I need to automatically create IDs for a repeating section. The repeating section is to create action steps for a project. I want the action ID to be "Project ID-Action ID". The action ID should simply start at 1 and incrementally go up as a new repeating section is added.

 

I hope that makes sense. Thanks in advance!


4 replies

Badge +12

@R_ADE ....there is a function in calculated control called "currentrownumbers". You can use that to generate your ID value.

Badge +2
Thanks! I'll try that see if I can get it to work.
Userlevel 5
Badge +14

Though someone has already mentioned how to get the current row number (using the currentRowNumber() function in a Calculated Control), it should be noted that the value will always 'normalize' to match the rows that are present. 

 

Meaning if we have 4 different rows of information (represented by unique color) 

 

Row 1

Row 2

Row 3

Row 4

 

and you were to Delete Row 3. The results would be: 

 

Row 1

Row 2

Row 3

 

So, if you had planned on using this method as a way to ensure you can match a Repeating Section Row "ID" to *some* data being generated from it somewhere else, this is not a particularly good method. However, if that does not concern your project, then this is fine. 

I am currently generating "one use only" IDs for one of my Repeating Section Rows, so if you do need to do it that way, we can go down that rabbit hole. As an example, using the above same data sets, if we were to start off with 4 Rows of unique data: 

 

Row 1 // ID 1

Row 2 // ID 2

Row 3 // ID 3

Row 4 // ID 4

 

And then deleted Row 3, we'd be left with

 

Row 1 // ID 1

Row 2 // ID 2

Row 3 // ID 4

 

See the difference? 

Badge +12

@MegaJerk , @R_ADE ....If your requirement is letting your users the instead of calculated control:

 

  • Add a SLT control and keep it in display mode
  • Connect your repeating section to MLT plain text column
  • Using workflow and query action get the SLT control values
  • Use set a condition to see if item is new:
    • If it's the new item - Update your SLT control with your row IDs
    • If it's not new item - Get the highest value it has and update SLT control if it's non-empty

Reply