How do you have an add form that auto increment the primary key? For a simple table (ID, FirstName, LastName) I want to have when you click the add button it has the ID field autofilled with the current max id + 1. Is that possible with appsheet?
Hi @Quy_Nguyen You can use MAX expression, ,only under some specific app usage conditions.The expression can be something like
However, please note that AppSheet typically does not recommend a sequential key generation as mentioned in
You may implement
a sequential key only if your app has only one user or if it is a multi-user app,
any two users are never
likely to add a record simultaneously or the app is not going to be used in offline environment for adding records.
I would not recommend this if your app has more than one user. The duplicate value can happen even if those two users are not using the app in a same time. It’s not a timing issue, it’s a syncing issue. If the other user hasn’t used (synced) the app for example within last two days, this duplicate key will happen.
I would recommend using this expression [_Rownumber]-1…