No personal data after login

Hello, I am creating a project management app where people login to there own account which I have managed to do due to my last post. If your reading this and your from the other form, thank you :D and that login has the "client" entity which has "name", "business name", "Phone number" and "email" and I have 3 accounts that can sign in and have separate data but every time I sign in with the 3 separate accounts I just get the data from the example record and I have to create the "client" accounts with the detail screen. When I look it does show that there data has saved but the data doesn't show up. So please how do I get it so it shows there separate data thanks :D    


Hi Haiden,


So you probably have a setup where you have some own datamodel, maybe a client entity with some attributes like business name and phone number and anything else you want to store about your clients.  And each client also has a record in the user table, meaning they can log in.

So let's say you want to have something like a 'MyProfile' screen, only available to logged in users, and when they go to that screen, they should see their own data, right ?

So, to be able to do this, you need to know for a logged in user, what client he is.  For this, you need to add the UserId to the client entity,  So when creating clients by the admin role, you add programmatically a user record for that client and store the id of that user in your client table.

So now, when a user goes to the "MyProfile" screen, you can use an aggregate on the client entity, with a filter on UserID = GetUserId()

Does this make sense to you ?

Dorine

 Hi,

If you want logical data separation per client you could consider to implement your app as a multitenant app.

Each client can then have their own users and OutSystems automatically arranges that each of them will only see their own data only.

https://success.outsystems.com/Support/Enterprise_Customers/Maintenance_and_Operations/How_to_Build_a_Multi-tenant_Application

Regards,

Daniel