we are currently trying to solve all online procedures for our Non-Profit Organization with Gravity Forms.
One of the forms will be a reservation tool for our members. We have different products (Product 1, Product 2, etc.) that can be booked by our members for 2 or more days.
The simplified form looks like this:
- Product (drop down field)
- Pick up date
- Return date
We then intend to use GravityView to display a calendar with the bookings of the different products for our members.
However, each product is unique and we therefore must prevent overbookings. In practice, the form should display an error if a member wants to book Product 1 within the date range of a previous booking for Product 1.
Does someone have an idea on how this can be solved? For now we experimented with gravity perks (limit submissions, date time calculator, …) but none seem to have the desired effect.
Thank you very much for your help.
A couple links that may help your direction:
If you already have Gravity Perks license, you might explore whether their Populate Anything perk can help you achieve the goal. Setting up a filter to confirm that no other entries exist within the date range(s) required.
If addressing through code, a form validation or field validation with a lookup for the GFAPI::count_entries would be similar.
If there is any risk that the days product(s) are booked for may not account for someone returning it on time, you may want to add a Gravity Flow workflow with an approval step to track when the item is returned (or have time-contextual reminders if they don’t). Or let them cancel a booking if it is no longer required.
Even if your use case can assume date of planned return will always equal date of return, the workflow may make the logic you are putting into Gravity View, GPPA or filters above could benefit from the workflow using a step with an expiration to make the criteria of which items to display as bookable.
It’s an interesting project - look forward to hearing how you’re able to address it when complete.