Hello AppSheet Community: I am trying to crea...

Hello AppSheet Community: I am trying to create a field that generates a code composed of a serial number, followed by a correlative number. For example: 002-00001, then 002-00002, etc.

For another group of users (who are located in another project) the series changes, for example: 003-00001, then 003-00002, etc. The idea is that it be generated automatically. Is there any way to do it with AppSheet?

0 8 365
8 REPLIES 8

Certainly possible, though may be a problem if you want them to be unique (see below).

To generate them automatically, youโ€™d have to have some way to determine what the appropriate serial number is, and a means to determine what the highest used correlative number is. Generating a new code given that is trivial.

It might be easiest to handle it as a Text column.

Keep in mind, though, that the app uses a local copy of your data; the central copy is updated when a sync occurs. Sequential identifiers are problematic because multiple users could all start with the same data, each generate the same next sequential value independently thinking theyโ€™re the first to claim it, and sync at different times. In such a case, earlier data will be overwritten by later data with the same identifier.

You can also read more about it from this articleโ€ฆ

help.appsheet.com - Sequential Keys Sequential Keys help.appsheet.com

Hi Aleksi, I understand the problems of working with a correlative key, but this case is not a key, it is a field that the application can generate automatically and correlatively, which does not allow the user to edit. In addition, in this case, being a single user for each project (understand number series: 002, 003, etc) there would be no danger of duplication.

@Steven_Coile

Thanks for your answer Steven.

Wellโ€ฆ the problem is the same if itโ€™s a key column or not if you have more users than one and you want an unique value. When you have only one user per project and if you can take care that other users are not able to add another project, then you donโ€™t have that problem.

@Aleksi_Alkio So, how to make the application generate correlative numbers? Can you help me?

Soporte,

as long as you are not going to have multiple users and you use the Appsheet _Unique key creator for all your tables, then you can also create a more human readable record key by concatenating Some value like your example of โ€œ2000โ€,"-",โ€œ0000โ€,[_RowNumber].

Row number can be problematic if you delete rows, so I always recommend that you remove the table option for Delete.

Sometimes using Today() date as part of a readable โ€œkeyโ€ is helpful. Hope this helps.

Are you able to add a user identifier to your code? For exampleโ€ฆ if you have less than 100 users, you could assign 01 to you, 02 to Mary etc. Then you could use a code like 002-020001 and they will be unique.

Top Labels in this Space