Using two databases for one calendar (one being private to the current user)

I set up a calendar with dates that will be preloaded for all users. I want to now allow people when logged in to create their own additional dates but only be viewed by them personally. How do I merge or be able to pull from both databases with two different privacy rules?

Hey @amber :wave:

Welcome to the Bubble Community! :tada:

Hmm :thinking:. Good question.

There are a few ways to do this. My recommendation would be to actually use only one database type. Then just have ones marked as ‘isPublic = true’ and then use privacy rules to constrain the data. That way you won’t need to have any constraints on the page at all. It will just show the user what they should be able to see. Does that make sense?

Sometimes, from my experience, the best thing to do is rework the database structure.

Hope that helps. :blush:

1 Like

Thank you! I’m very new to this and so far have figured out everything
else but this lol. If you have a minute could you explain this a bit further? This is the current structure I have.

Hmm :thinking: @amber

Sorry, I didn’t get notified for this.

Well, it looks like you are using events as the data type. So that is good. Can you share a screenshot of the issue you are having exactly then? Is it just not displaying the data you need? Giving you an error? Let us know. :blush:

Thats ok! I really appreciate the help. I have the Calander working and I entered all special events that I would like to show up for all users. This is something that I would like to update monthly of all users.

The part that I’m not sure how to add is allowing the users to add their own dates to the same calendar. These would be specific to them so I wouldn’t want other users to be able to see them. I may need to even make then a different color than the ones we are loading in.

Ok. Let me see if I can set up an example for you on Monday so you can see how to do it and copy what I do. :blush:

Fantastic! Have a great weekend!

1 Like

@amber :wave:

Ok, here you go. Here is an example for you. This calendar displays the events that are entered by an admin that are marked as ‘sharedEvents’. Then the other ones are only visible to the creator of the event. I disabled the button so people don’t create a bunch of events.

The orange events are created by the user. The blue are shared events.

Editor: testApp42wCleanDB | Bubble Editor
Preview: NoCodeMinute Free Forum Help

Hope that helps! :blush:

Let me know if you have any questions.

Note **The important part is in the database structure and the privacy rules. **

ok great! I’ll go over it!

1 Like

I just wanted to let you know that you did a wonderful job, and I am truly grateful! It works great!!

This topic was automatically closed after 70 days. New replies are no longer allowed.