Create content that is only visible to some users

I am making an app where the users can create events and invite people to these via email. If a user is registered with an email which has been invited, I want that user to be able to see that content on the page when he is logged in. Is that possible? If so, how do I do? The user types the email addresses into a multiline input.

Many thanks in advance

Yes, it’s possible.

High-level approach goes like this:

  • When someone is invited to the event, store that fact in your database
  • On the page where you want it to show up, set a condition to show a group with the event content inside of it, and have the condition set to be visible only when the user’s email is in the list of emails who’ve been invited.
2 Likes

That’s the thing, should I create a new data type or as a new field under the “Event” data type? If as a new field, what type? List of users?

Scott will know best, but you have two options (or maybe four).

  1. Have a LIST of “Registered USERS” on your EVENT.
  2. Have a LIST of “Registered EVENTS” on your USER.
  3. Both.
  4. Have a separate REGISTRATION thing which is one USER field and one EVENT field, and have a LIST of REGISTRATIONS on USER and EVENT.

Personally, I would go with 4, as it is not really more work that 3, and you will certainly want to do things like “list out the times people registered for this event” or “delete a registration but still be able to report on it” stuff. None of which you can do with 1-3.

If this is just something really quick then I might go with 2 to keep it simple for now.

2 Likes

It worked, thank you very much. I used option 4. The only problem now is that the events is visible for everyone. The users should be able to show the events that they are invited to in a repeating group. I have tried with the solution as shown in the picture below:

Not sure quite what you mean.

If you list the Registration’s Events on your event RG, and constrain on the current user, then you should just get the ones they are registered for ?

1 Like

I think I did it right but please take a look at the pictures below. The problem is most likely in the multiline input (see the first post) but I do not know how to solve it. Any suggestions on how I should build the workflow with a multiline input? As it looks now, the event the user creates is visible for everyone regardless of which email address the guests have registered with.

32

I forgot to tell you that the user will separate the e-mail addresses with a comma in the multiline input. I don’t know if it’s even possible. If you have any other suggestions on how I could make this work, please let me know. Thank you for your efforts so far!

Hi there,

Yes, it is certainly possible, I use the same method in Sprrk.ly to send emails. Mine is slightly more complex, as it validates each email as well as allowing a preview, but the basics are the same.

So I have a multiline input…

I then extract the emails into a repeating group using a regex. This is the key bit here for getting the emails into a list from the multiline.

[^,\s][^,][^,\s] is the regex you need.

And then I send the email to the list.

In your case I think you will need to use the email list to create the registrations for each user. So allow them to enter the emails, and then process each one having extracted with the regex.

Let me know how you get on.

1 Like

Thanks! I don’t understand how to link all the data since they all are of different types. The RG with the emails is a text type and the user under registration is a “user”. And then the “list of registrations” under the event? Sorry for being so sluggish, I am relative new to Bubble.

I’ve found the solution. When the user creates an event, a registration is also created. On the registration data, I have two fields, one “event” and one “list of texts”. The event on the registration is a “result of step 1” (see the picture) and the “list of texts” comes from the RG with the emails. On the page where the event is supposed to be shown, I have a RG with the data source as “Search for registrations”. I then constrain it to only show the registrations the current users mail is in. Thanks a lot for all your help!

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