I need to find a way to have an admin and the users of a company to see only their data

Hello!
I am trying to build a software to match No profits’s activities and companies’s employees.
I need to fit all the relevant employees a of company (example google) under google’s company name.
How do i make sure of this in the database?
should i also set the “type of content” of the page with the company value?

moreover i want to have the admin to have the “invite an user” ability but i cannot do it since the current user is not under any specific company page.

I believe that if someone knows how this works it could be super easy, but i have no idea how to handle this and I also watched some video tutorials but they have not cleared my doubts.

Thank you for your help,
Giovanni

All should be easily achievable with proper database structure and privacy rules

@giovanni.canepa Welcome to the community!

Some concepts to consider:

  • Add a userRole field to the userDataType. Using an options set here with some roles like adminUser, premiumUser, regularUser would work well
  • Build conditionality when clicking things using the above
  • add a companyDataType field to the userDataType and of course add the companyDataType to your dB in order to do this.
  • Build page access conditionality using the above
  • You may also add privacy rules using both fields in ways that make sense for your app

The above are just a few thoughts that hopefully spark some ideas on what you are trying to achieve

Best of luck on your bubbling journey!

I think i now prefer that a first user is creating a company login and then invites colleagues to join the company account.
this first users will be set as admin and will be able to see different things.

Now, i have setup a data type set as “Company” (this will be the company each employee will be registered unders) and i have created the link of the data entry in the “User” data type.
In the registration process I am now asking for the company name (from there on the company should be registered and appear in my database) but i cannot find the correct way of setting my workflow “sign the user up” in the correct way.

I get all the data like first name,last name and email but the entry of the company is not recorded in my database.

does anyone know how i can do it?

thank you very much!!

Probably while signing up the user, you are not setting additional fields such as role or company name. Check the running example of a sign up below with the workflows provided.

company

Here is the workflow:

And here is the dropdown:

Thank you for your reply but i’m not sure this is what i would like to show.

I don’t want people who register to see which companies we work with.
This is how I imagined the structure

For this I have created a database called SaaScompany which is aslo in the user, this is done so that every user is allocated to one only one company

and i dont know what to put in here so that when the first user of a company signs up he/she creates the comapny account under which later he/she can invite other coworkers to join.

thank you already for your help,
Giovanni