Create objects/things in loop

Hi,

I’m making an app where users can add a reservation to a room. Basically the setup is that one room can have multiple reservations (for that same day).

Now what I want to achieve is that when a user indicates he/she wants to reserve more than 1 spot in his/her reservation, multiple reservation ‘things’ are created and associated to the room, for this user.

It seems to be impossible however to create multiple Reservations (a list of ) things based on a number that is given in the input field ‘amount of participants’.

How do I achieve this? I need the list of reservations because i’m also using that to calculate howmany free places there are (amount of configured available places per room - the :count of made reservations).

There’s different way to achieve what you want.

For example, if your Room have a field that is linked to reservation, your Room item probably have a capacity field, so you can compare the Current room reservation’s number of participants:sum vs current room capacity

It’s also possible to create a loop using Backend workflow that will create one reservation for each participants. You will trigger the same backend workflow until the # of reservation created reach the # of particpants

Hi @Jici

Thanks for your response.

I already tried the first idea you offered, but that only works if there is no date involved. In my app, it is possible to reserve a room on several days. I would need to check the amount of reservations made for that specific day as well.

Thanks,

This is more complex and depending on how you have created your DB, the solutions is also different.
Did you try to use advanced filters?