# Link one user to multiple accounts

**URL:** <https://forum.bubble.io/t/link-one-user-to-multiple-accounts/283754>\
**Category:** App Organization\
**Created:** [September 17, 2023, 5:24pm UTC](https://forum.bubble.io/t/link-one-user-to-multiple-accounts/283754 "2023-09-17T17:24:46Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![adrianjacecko2000](https://avatars.discourse-cdn.com/v4/letter/a/e9a140/32.png) [@adrianjacecko2000](https://forum.bubble.io/u/adrianjacecko2000)\
**Post date:** [September 17, 2023, 5:24pm UTC](https://forum.bubble.io/t/link-one-user-to-multiple-accounts/283754/1 "2023-09-17T17:24:46Z")

</div>

Hello,

I want to create an app that helps with client onboarding and documents exchange. However, I have problem with user “Project manager”.  
I have two types of users:

1. Client
2. Project manager

I want project manager to be able to log in to all his clients apps using the same e-mail.

I came up with the idea of login structure like this:  
Client ID  
Email  
Password

How to set it up? I mean - in database, privacy rules. I think that I tried almost everything…

Kind regards

---

<div class="post-metadata">

**Author:** ![arensbpa](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/arensbpa/32/192304_2.png) [@arensbpa](https://forum.bubble.io/u/arensbpa)\
**Post date:** [September 17, 2023, 7:16pm UTC](https://forum.bubble.io/t/link-one-user-to-multiple-accounts/283754/2 "2023-09-17T19:16:42Z")

</div>

You don’t need two separate user types for project managers and clients, they are both users. Instead create an option set for the user data type called “type of user” and add “client” and “manager”. When the user onboards you can set their type as either a project manager or a client.

Then create a a data field on the user called “associated project manager” and make it a list of users. When a client signs up you can add a project manager to the users list of associated project managers.

---

<div class="post-metadata">

**Author:** ![adrianjacecko2000](https://avatars.discourse-cdn.com/v4/letter/a/e9a140/32.png) [@adrianjacecko2000](https://forum.bubble.io/u/adrianjacecko2000)\
**Post date:** [September 17, 2023, 7:53pm UTC](https://forum.bubble.io/t/link-one-user-to-multiple-accounts/283754/3 "2023-09-17T19:53:18Z")

</div>

Thank you very much for your reply ! I don’t think I understand all of what you wrote. Let me put it in another words. Will it work in this case ?  
Case:  
I have a comany “ABC”. This is my account. I want to have two clients working in this company to work within this company’s data as well as project manager on our side. But the thing is project manager is responsible for company “xyz” as well and he needs to log in to this company’s account. How to set this thing in “Privacy rules” section ? And do I need Company/Client (whatever) ID ? By the way, I will sign the user up myself 🙂 Sorry for bothering you.

 ![Zrzut ekranu 2023-09-17 214809](https://us1.discourse-cdn.com/bubble/original/3X/f/5/f51e6375632fb141bda5398990dd648136b79f0d.png)

---

<div class="post-metadata">

**Author:** ![adrianjacecko2000](https://avatars.discourse-cdn.com/v4/letter/a/e9a140/32.png) [@adrianjacecko2000](https://forum.bubble.io/u/adrianjacecko2000)\
**Post date:** [September 19, 2023, 5:55am UTC](https://forum.bubble.io/t/link-one-user-to-multiple-accounts/283754/4 "2023-09-19T05:55:16Z")

</div>

Do you have any idea what could help here ? Sorry for bothering you.

---

<div class="post-metadata">

**Author:** ![arensbpa](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/arensbpa/32/192304_2.png) [@arensbpa](https://forum.bubble.io/u/arensbpa)\
**Post date:** [September 19, 2023, 3:11pm UTC](https://forum.bubble.io/t/link-one-user-to-multiple-accounts/283754/5 "2023-09-19T15:11:23Z")

</div>

![image](https://us1.discourse-cdn.com/bubble/original/3X/b/7/b7a1ef54e9aad67e467cc4b54c46d220211edd88.png)  
So like this right? You have companies that have accounts and then clients can access that companies data and then a project manager on your side can access companies that they’re managing.

You can do something like this:  
 ![image](https://us1.discourse-cdn.com/bubble/original/3X/c/a/ca098c603ec7cd7006c791ad9e109ff692b94823.png)

![image](https://us1.discourse-cdn.com/bubble/original/3X/5/d/5d4bcdc987e6ee4ed8d7413aa2da81ac9c6748ea.png)

Your project managers could then toggle between company accounts simply by changing the “active account” from company x to company y, you could use a dropdown to do this. Your clients can only view data for their associated company. Your project managers can only view data for their associated companies. You could also set different permission obviously based on user type (managers can do certain things that clients can’t).

---

<div class="post-metadata">

**Author:** ![adrianjacecko2000](https://avatars.discourse-cdn.com/v4/letter/a/e9a140/32.png) [@adrianjacecko2000](https://forum.bubble.io/u/adrianjacecko2000)\
**Post date:** [September 19, 2023, 8:11pm UTC](https://forum.bubble.io/t/link-one-user-to-multiple-accounts/283754/6 "2023-09-19T20:11:27Z")

</div>

Thank you very much ! You are very helpfull 🙂 I will try this one. But I have last question. How should I log the user in? I have the login page. The user types Client ID, e-mail address and password and what’s next ? I got stuck at this point. Should I set the custom state ? If so, how ? What rule should I use to simply show proper data ? Or should I create separate login page for project managers and clients ? Sorry for being intrusive 🙂

 ![image](https://us1.discourse-cdn.com/bubble/original/3X/7/0/70d9ba768bee7460df03df9752ae0e60fa509957.png)

---

<div class="post-metadata">

**Author:** ![shaneF](https://avatars.discourse-cdn.com/v4/letter/s/d6d6ee/32.png) [@shaneF](https://forum.bubble.io/u/shaneF)\
**Post date:** [September 19, 2023, 9:43pm UTC](https://forum.bubble.io/t/link-one-user-to-multiple-accounts/283754/7 "2023-09-19T21:43:24Z")

</div>

you need to have a field on ALL your tables that is Type Company so you know which transaction belongs to which Company… then you need to have a CompanyLoggedIn field on your User Type which you can update at Login. Then in your Privacy Rules tab, you can restrict all your transactions by the LoggedIn field.  
There’s some videos on YouTube about Privacy Rules. They explain this way better that i just have.
