Database structuration to pre-identify content for users

Hi everyone,

I am happy to be here, quite new to Bubble but dug into some tutorials and manuals.

I am starting a new web app and I would like to have a recommendation on how to structure my data in order to build it smoothly.

Who am I?

I manage a B2B company dedicated to delivering online training courses in management.

What I want to do?

I would like to create a web app hosting our training content: videos + files + quizzes.

What is my problem?

I have one crucial question I would like to be solved before jumping into the design of my web app. This question deals with restricting access to the app/the content to certains users.

Let me give you more context: my clients are companies, and we select which content is best suited for Employee A, Employee B etc.

1 - Therefore I would like to be able to pre-register a list of employees with the contents they should have access to.

2 - Similarly, I would like to pre-register a list of employees which I would like to give the opportunity to sign up.

I am struggling to define what would be the best way to do this into Bubble.

What did I try?

You’ll see here that I am quite new to Bubble :slight_smile: I tried two options.

Option 1: Manually add users with their emails, with a yes / no field in the User type, in order to let them sign up if they are approved. Problem is: it won’t let user sign up (email already used).

Option 2 : Create a type of data ‘Input data Users’ where I add all the pre-entered information (ex: Email address : test@gmail.com - Content A : yes - Content B : no)

Problem is: I am not sure I can edit the workflow to match the current User email address with the fields in the ‘Input data Users’, and make this conditional.

This is clearly a newbie problem but I think that would help me a lot because my app after that is pretty basic. Could you please share some ideas on how to structure this?

Thanks a lot!

Grégoire

Hello !

For Your first question you should look at « option sets » there is a post as an announcement made by the bubble team recently on the forum with lots of details.
You will be able to create option and make some contents visible to only a some type of users + add some privacy rules easily.

For your second question (invited employee), I guess there are many ways to do it and don’t really know the best. But here are two solutions :

  1. When you or the company invite new members you could create a temporary user account with a temporary password (you can create random password in workflows) and send it in the invite.
    You can then pre-filled some data field if needed (like company the user belongs to), regarding your needs.
    You could also have a time limit set and schedule a backend workflow deleting the invite and the account after a certain time (48h, 1 week…).
    Just a thought, creating a user account for someone else might have some issue with privacy laws depending on what you are doing.

  2. You could create a new Data types « invitations » with a data field « emails » (list) in it, and other data field if needed.
    You can create a data field « Invitation » (list) in each company that invite employee.
    When an employee is invited : make a workflow that 1. create the invitation 2. Attached the invitation to the company.

  3. If you don’t need to store invitation info to track it for each company, just send an email to the invited user :slight_smile:

Hope it helps

Hi thank you for your message, much appreciated.

I am trying to do step after step, so I dug into option sets.

But it seems while option sets are manually defined, it still needs the user to select some fields.

At the contrary, I would like to assign some contents to some users before they sign up (and without them having to know it or to take any action).

Basically what I would want is setting a first database I define before the users sign up, which look like this:

And for each content having fields like these:
Capture d’écran 2020-12-10 à 01.13.28

And finally, when for instance test2@gmail.com user signs up, the page he gets contains the content I have previously assigned him, for instance like this:

I really struggle to define how to structure this because I can’t update information for the User type before the sign up.

What could be the best way to do it?

Again, thanks a lot for your help

Check this :

Here are the sets of option sets :

Here is the user Data type, with a list of content he has access to :

Here is the content Data type, within which you set the kind of content it is when created :

Here is an example of workflow you can create when inviting a new user :

In you data you will find something like this :

So here for example when someone create a content, you have to define what type of content it is. When saving the new content, you display the list of content-type option set. and save the selected ones in the database.
When you invite someone, you can define which content type he has access to.
And then you just make invisible + not accessible (with privacy rules), the content type he is not supposed to see.
In my example, as data field are lists, you can say a user has access to one or many content types, and a content can be of one or many content types.
So here this is just a quick example, but I think it is the right solution if you have to manage a lot of data in the future, set simple rules

Wow, thank you very, very much for this detailed explanation.

I’m quite new so I’m digging everything in your post and trying to do. Thanks a lot, I will keep you updated!

Grégoire