I know the answer with new apps: create a new app, add the Users service, delete the newly created empty Users table, add the existing Users table, shared with other apps. This is easy and it works.
And I’m pretty sure in the past I have tried this also with cloned apps.
But today I’m not able to share the Users table with a cloned app: clone the app, delete the Users table, add the existing Users table, and the Users table is not visible in the Users service page, and the app doesn’t work.
What am I missing?
I vaguely remember having to inspect the settings in anvil.yaml
. Something about the App’s Python name of the table not matching the Database’s.
Yes, I had to enter the correct table id here (the yaml file still contains the id of the table I just deleted):

Is it weird or is it a bug, that it works with a new app and not with a cloned app?
I vote for bug.
2 Likes
One more thing I would like to add: if you need to use the tables with SQL, the relation “table_123” of a cloned app will only be visible to SQL after manually editing the table, for example by changing the name of a column and changing it back to its original name.
Hi @stefano.menci,
Actually, what you’re seeing here is revealing some history of the Anvil app YAML format. In the beginning, user_table
was a table ID, and you did need to change it the way you’re describing above. However, when we released support for multiple databases, this wasn’t sufficient any more. Nowadays, user_table
is the Python name of the table, usually "users"
, so it will work with any database, clone, etc. Of course, it is backwards compatible, so a table ID is still valid too, but new apps will always use the string version.
You probably only ran into this because you were cloning a very old app. You can safely change the YAML to point to the Python name of your Users table, then you won’t have the problem again 
I understand that this is a problem only for a few old users, and that there is an easy workaround, so I’m not expecting a fix any time soon.
I created our company Users table long time ago when I created my first app. That Users table is shared with all the apps, and will always be shared with all new apps, cloned or not.
Will I always have this little problem because our Users table is older than the multiple databases?
Or will I only have the problem when I clone old apps created before the multiple databases?