Using the same login Users table across Apps

I use them, its quite simple since anvil/python at times can be so simple that your wouldn’t initially think it would work.

Lets say you have two apps, A and B, and you want them to share the same users table.

Lets also say you already have the users service installed, working, and have user(s) who have logged in at least once in App ‘A’, but you want app ‘B’ to use the same users.

  1. Add the users service to app B
  2. Log In to App B by creating a new user. (This will cause the ‘Auto create columns’ to create whatever the Users table needs in App B)
  3. Rename the users table to something else like ‘Users_old’ or whatever.
  4. Using the Classic IDE (If the Beta IDE still has not implemented sharing tables by the time this is read), Click the Plus + sign in the data tables to add a new table and navigate to App ‘A’ s users table and select it to share the same users between ‘B’ and ‘A’.
  5. Optional: Compare the users_old with the linked ‘new’ Users table to see if there are any columns missing from the linked table. Then You can delete the ‘_old’ one.

That’s really all I have ever done and it works.

Your users table will now only be as secure as your least secure app! :partying_face:

5 Likes