One to many relationships

hey all

im new to bubble so still trying to wrap my head around the database, im used to using SQL.
i have an issue that im sure someone on this forum will be able to point me in the right direction.
im building an asset management tool, in this site you can create events on each event the user has the ability to attach mulitple photos to the event.

i have two datatypes

Events and Events-Pic

i have linked both together by adding ‘id’ from events into Events-pic

but how is the id from the event saved to the Events-pic when i create an entry into Events-pic datatype from a form, this form is creating a new thing in Events datatype, and further down the form, is an option to add a photo and a title, this is aved into Events-Pic but how do i link the both together?

Don’t use the id field. Bubble already has a built in way of connecting datatypes and it is done with the way you set up your datatypes.

So you have your two datatypes but in Events, you add a field called Events-Pic and the type you choose is “Events-Pic”. Scroll down in the list and you will see this (and every other) datatype in the list. If it is not in the list, it means you haven’t created the datatype yet.

You then click the tick box to “make this field a list”. Then in your workflows, you will “add item” to the Events datatype.

For example, you’ll have “make changes to a thing” workflow where that thing is “Events” and then you’ll be able to add the Events-Pic to that thing.

Hope this helps.

hi thanks for the reply, im not quite getting the process, ill explain it a bit better.

button on page → create a new thing (datatype events) New event (new page)

new event page
inside new events page is tab control, inside this tab control is two fields and a button, field one is picture uploader, field two is text box for picture title.
button → create new thing (in events-pic)

i have added field events- pic to events
i just dont seem to be able to find how to link the unique id from the events-pic to events field