How to Create Dynamic Data Based on Check-in and Check-out Dates in a Repeating Group

Hi everyone,
I’m literally facing the final boss right now and need help with this.

I’m currently in the last part of my program, which is about creating travel packages with hotel bookings and converting them into a PDF for the client.

Now I’m working on the final section, which is about adding recreational activities or a customized schedule for the package.
The table should be generated based on the hotel bookings.

For example:
A hotel booking from January 10 to January 15.
When reaching the activities section after adding the hotel booking, a prefilled list should appear showing the days from the start of the booking to the end, including all the days between the check-in and check-out. These days should be filled dynamically with random activities based on the available activities in the city where the hotel is booked.

As shown in the table below:

| Date | Activities | City |
|------------|-------------------------------------------------- ----|-----------|
| Jan 10 | Check-in at the hotel and explore downtown | City |
| Jan 11 | Recreational activities for the day | City |
| Jan 12 | Recreational activities for the day | City |
| Jan 13 | Recreational activities for the day | City |
| Jan 14 | Recreational activities for the day | City |
| Jan 15 | Check-out from the hotel and head to the airport | City |

Here’s what I need:

  • The first row should include the check-in date with a welcoming message like “Check-in at the hotel” and the city name.
  • Dynamically generate the days between the check-in and check-out with random activities for each day based on the activities available in the city.
  • The last row should include a farewell message for the end of the booking with the check-out date.

The issue:
I have multiple hotel bookings and need to generate the same table for each booking in the same list.
Additionally, I couldn’t link the city of the booking to the appropriate activities so that the correct activities appear for each city.
I’ve tried a lot of ways, but nothing worked. Maybe it’s simple, but I just can’t figure it out.

Any help is greatly appreciated, and thank you all in advance!

Note:

  • I have a database for hotel bookings.
  • I also have a database for cities and their activities.

Thank you, everyone!

I wouldn’t use “random” activities here but instead have chatgpt select activities from a list based on inputs from the user… (be a little extra selling point too)

I’ve done something similar (although much more involved) for a contracting company recently.

the best way to do it would be to break it into stages:

  1. determine the city
  2. determine the days
  3. determine how many activities per day
  4. create a thing for each activity (ie a timeline)
  5. create the hotel timelines before and after - account for drive times etc if needed (use google api)

data structure something like this:

contact - name, phone, email
hotel - name, address
booking - city, contact, date, list of timelines (possibly - or could be better on a new datatype for holding heavier data)
cities - name, address
activities - city, name, price
timelines - name, activity, hotel, booking

1 Like

I’ll try that thanks for the reply bro

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