Data table userID auto increment

In my user data table , I have an attribute of UserID(int) , can I use any key word like “auto-increment” in MySQL making it add one automatically when a user record was added?

Are you using it for a unique ID, or is it a specifically formatted account number (for example)?

If it’s the former, then you don’t need to do that. Anvil keeps a unique ID automatically (which you can retrieve with get_id() should you need to).

Read here : https://anvil.works/doc/#data_tables_api
and search for “Row ID”

2 Likes

I prefer formatting by myself, and I did it. thanks anyway.

@mch8418 Can you please explain how you did?