Yes! You can use the Lookup field to filter choice options based on quantity limits, dates or other custom criteria. In this case, you’ll need two forms: 1) a source form that contains your choice options and quantity limits, and 2) an order form with a Lookup field that filters the available choice options.
To hide unavailable choice options using the Lookup field:
Create a source form and populate it with your choice options. In this example, we’re listing time slots available based on date and time. This form includes a Date field, a Time field, and a Number field for the quantity available of each time slot.
Populate the form entries with dates, times and available quantities. You can populate these values manually by creating new entries on the Entries page or directly from the form. You can also import entry data into the form via an Excel spreadsheet.
Create the form that allows people to sign up for time slots. Add a Lookup field and look up choices from the Time Slot Inventory form. Then, set the Include option to only include entries where the number of available slots is greater than zero. Optionally, include a Number field on the form (ex: ‘Number of People’) to allow more than one person to book a single time slot.
Select the Specify Quantity option and set the Quantity Available to the Availability field on the source form. Make sure to include an error message as well (ex:
="There are only " + TimeSlotsAvailable.Availability + " slots available."). This message will appear if someone attempts to sign up for more slots than are available. Optionally, if you’re allowing more than one person to sign up at a time, set the Specify Quantity option to the ‘Number of People’ field.
Make sure to save your changes.
Now, you can test out your workflow. For this example, we can submit an entry to claim all of the available time slots for 6/16/2021.
Once we submit our entry, the Lookup field will automatically filter out the unavailable time slot.
If someone attempts to sign up a number of slots that exceeds the quantity available, your custom error message will appear.
Learn more about filtering choice options with the Lookup field in our help guide.