Apr 25, 2023 08:38 AM
Background: I'm currently building a surfboard reservation system and have been running into roadblocks trying to stick to the free plan because I can't utilize the advanced calendar features. I have two tables currently, 'Surfboards' and 'Reservations'. The reservations table uses a start and end date that can not be viewed on a singular calendar view.
I've thought of a workaround that would require a third table, 'Schedule', and would have a single date field. I want to use automations to create a new event on the schedule for each day of the reservation.
Ask: Is there a way to automate the creation of multiple records, one for each day between a date range (start date, end date).
Patrons use a form to submit their reservation requests. They indicate a start date (w/ time) and an end date (w/ time). There is a maximum number of dates you can reserve a surfboard for (5). I am using the following formula to generate an array of dates for each date between the start and end date:
Supported source data inputs for use in repeating groups include:
I'd use a script, but I need this to run automatically. The only idea I currently have is creating a 'calendar' table and just populating it with every possible date over the next two years.
Apr 25, 2023 10:00 AM
Instead of using arrays, try creating one field per rental day. I've done this before, but not on the free plan because of the low automation run limit. You're going to blow through your 100 automations in no time at all, and you're going to be be bumping up against the 1200 record limit in a base pretty quickly.....
Having said that, here's an option for you.
Patrons use this form to request their reservation.
Calculate the number of days the rental (1-5)
Use formula fields to create dates for Days 1-5.
Create an automation that is triggered by a form submit and uses conditional groups to create x records for x number of days (for a 1-day rental, it creates 1 record; for a 5-day rental, it creates 5 records).
Link to shared base here.
Apr 25, 2023 02:33 PM
Sticking with the free plan is going to be difficult. You have only 100 automation runs per month and you will eat through those very quickly when creating multiple records if you cannot create an array. You could use a table of dates, but that is going to eat into you 1200 max record count.
Why don't you use scripting extension? You can have unlimited scripting extension instances in all plans.
Apr 25, 2023 10:33 PM
Hm, you can just paste your formula's output into a linked field and that might work fine I think? It would create one record per comma separated value like you need it to as long as a record with the same primary field value doesn't exist in the linked table
To ensure that, you could create an autonumber field in your reservation table and modify your formula to add the autonumber in front of the date, so that it outputs something like
- 1 - 4/1/23, 1 - 4/2/23
- 2 - 4/5/23