Automatic code generation (Creating unique SN or UID)

Hi!. I have a form where codes are created with consecutive numbers starting with the letter “R,” for example: R1. I would like to know if it’s possible to automatically generate a new code by adding a number to the last record made.

Welcome to the community, @jessicanon! Did you mean you wish to have an SN automatically be filled up with an incremental of 1. E.g., R1, R2, … and so on?

Yes, exactly :slight_smile: Do you know how I could solve it? I tried with this formula: concat(${cod_recol}, “+1”), but it didn’t work for me (I am new to this)

@jessicanon, maybe you could do it as outlined in the image shared below:

In the survey tab of your XLSForm:

Data entry screen as seen in Enketo: When nothing is entered

Data entry screen as seen in Enketo: When the name is entered

Data entry screen as seen in Enketo: Now for other entries, you will not need to enter anything

Reference XLSForm:

Last Saved.xlsx (10.0 KB)

2 Likes