Sequential numbering on repeaters


I would like to create a repeater, where a user enters a description into a text field and clicks button to add this to a new row in the repeater. However… Is it possible to have a second column that assigns a sequential number?

For example:

  • Description 1 - DGDID00001
  • Description 2 - DGDID00002
  • Description 3 - DGDID00003

The DGDID is the same for every line, but when the users clicks add, the 00001 increments with every added row. So it appears the new row is getting a unique ID assigned.

Hope I am explaining myself well…

Thanks, Matt

Use a global variable to store the number. Every time you add a row, increment the variable. Optionally, decrement the variable every time you remove a row.

For example, a global variable named Counter with a default value of 1.

When you add your row you can add [[Counter]] into its own column and then increment it like so:

//Add your row stuff
Set variable Counter to: [[Counter + 1]]

Then you can use the column that contains the counter value however you like in your repeater, such as adding it to text or displaying it somewhere else on the repeater item.

Set text on someWidget: Description [[Item.counterColumn]] - DGDID0000[[Item.counterColumn]]