Not sure how to set up user host/attend event

As with all things, my project is getting harder as I get into it.

Basically I have a “user” type, and an “event” type. The user can do two things:

  1. view events and attend them. The list of events he intends on attending/attended gets stored
  2. create his own event. Th list of events he created get stored

So one of the fields of a User is a multiline “Event attended” and another one is a multiline list of “Events hosted”

OK, that seems straight forward.

Now here is where I get a little lost… (I’m really new at this)

I have a button that says “create a new event” and it goes to a new page sending the user to that page.

How does a new event get made? I want the groups on that page to refer to this new event to autobind the inputs.
This is what I thought to do

(sorry about the red marks, its just the name of the app)

When the user hits “submit event” how does the new event get added to the top of the users list of events hosted?

This is what I tried.

I have low confidence I have done this right. But the final question is:

Do I need to keep a list of events? Later when the user wants to search for some events in his area, how do I search and present all the available events, if all the events are kept with other users? Or do I need to keep a master Event list?

The event has a user field, and the user has a field of a list of events…is there weird looping there or something?

I’m not sure how to set this up best

If “event” is a table in the database, and you want to create a new entry, then use the “create new thing” action. The thing to create is an “event” and you fill the fields of the table with the inputs from the page (title of the event, location, max attendance, whatever).

If you want to modify an existing event, then you use the “change a thing” action.

If you want to add the new event you just created to the user who created it, you’d use the “change a thing” action, select “user”, and add “the result of step 1” (where you created the new event) to the user’s list of events hosted.

Also, if you’re having trouble with that idea, then you’re going to be asking for more help in the future. You might as well rename your database things so that you don’t feel the need to censor them. Bubble is a visual programming environment, so screenshots are usually necessary to get help. You’ll save yourself a lot of time.

1 Like

Thanks I will do that. And I am definitely going to be need more help on setting this up.

I get the idea of creating a new event, and the table of events, and how to modify them. What I’m having trouble with specifically is the linking of events to attendees and hosts.

There will only be one host (so obviously that can just be a field in the event)… below is me thinking aloud and writing…

But there will be multiple attendees (<100, but more likely <10, but there is no reason there can’t be more), so…

  1. the event needs a multiline field with “attendees” which are users
  2. the attendee needs a multiline field with “events” that he attended
  3. the host needs a multiline field with “events” the he hosted
  4. all three multiline fields need to be addended at the time of event creation, or event subscription.

But I don’t quite get how i am going to address an event if the attendee or host wants to cancel it.

The host will always have his list of hosted events available in his dashboard. If he clicks on the second one or fifth one or whatever… how do I take him to a page with that event in it for him to cancel it. Once at that page, how do delete the event from the event list?

I think if you replace the word “multiline field” with “list” you’ll get it.

When you create a new field on a table in the database you can tick the box to make it a list. Throughout the rest of Bubble, when you reference that field, you’ll get the list modifications in the expression builder (such as add and remove).

You can get away with simply having a list of events on the user and a list of users on the event as long as you don’t need to record any more information about that relationship. For example, just adding to a list won’t record the date/time that entry was added to the list. If you need to attach more information then you’ll need a third thing, something like “user-event-link” which will have a field for user, a field for event, and then fields for any other information. In that case the user and event things would have a field for a list of “user-event-link” things.

At a minimum you’ll need two types of relationships. Users would need an “attended” list field and a “hosted” list field which would both list events, and events would probably need two list fields for users as well. So it’s probably better to just start out with three tables instead of two, that way information like host/attendee can just be a field in “user-event-link”.

That’s how to think about it. Drawing a picture might help.

1 Like

First off, thank you for all the help.

Ok, I’m trying to have a go at this . I got lost quickly…Sorry for having so much dumz.

When I go to a “create event” page, I need a workflow that creates a new event. I realize that in my Data, I have “Event”, “User”, and now “chat”, and that these are master lists of all these things.

The event has many fields that we have discussed. I see that it is keeping a masterlist of these events in the “data” screen. yay.

So now I have the user press “Create a new event” from his dashboard…and he is sent to the “create an event” page.

So I see “upon page load” I can create a new event. Do I do that then? or do I do it when I hit the “Submit” when all the data is in place? Im confused about when the present event gets made and how it gets put into the list of events.

I’ll autobind the fields I want. but bind them to what? I want to bind them to the present event, but not one that is in any list yet. Then when I press the “submit” button I want to load this new event into the list of events. When I press the button I need a workflow to get non-autobinded data to get them into the present event and I should be able to take all the autobinded data into an event thing, and put that event thing into the master list of events. Yes? I guess i’m confused on what actually created the event and what actually gets it into the list of events.

I see also, there there are group elements, which I thought were just enveloped for other elements. But it has a field “Type of content” and I put “Event” there, and fields refer to the parent when autobinding.

Make sure that your database has all of the tables and fields you need first.

Build a form on a page by adding input elements to collect all of the information you need to fill the fields in the tables.

Add a button at the end of the form and name it something like “submit”. (it’s best to have all of the form inputs and the button in a group together)

Go to the workflow for when the “submit” button is clicked either by clicking on the “go to workflow” button in the button’s parameters, or by going to the workflow tab, creating a new workflow, and adding an action for when an element is clicked.

When you have a workflow, add an action to it to “create a new thing.” Select a thing of type event. Add the fields from the event table and use the dynamic data expression to put the values of the inputs into the fields.

Add an action to change a thing, select user, and change the current user’s relevant field. If it’s a list, then add the result of step 1.

Ok so the action of “add a new thing” and adding the fields to it basically takes the current inputs to a new thing and adds it to the list of things. This is basically what I have done.

So what is the deal with groups? Why is there a “type of thing” for a group?

“Add the fields from the event table and use the dynamic data expression to put the values of the inputs into the fields.”
Shouldnt autobinding do this? If so, that is why I am confused as to when the new thing is being created.

I guess if there is only one button, that needs ot be pressed, there is no reason to autobind to save on workflows. correct?

Anyway, I’ll try to get something going tonight. Thanks again.

You should start using screenshots. I use the Windows Snipping Tool.

Stop worrying about autobinding. That’s an advanced option.

Have you been through any of the instructional videos or tutorials?