Jun 02, 2020 10:11 AM
Hello Airtable Community! I have a question about creating an EQ reservation/checkout system in airtable. My nonprofit already uses airtable for keeping track of our film production equipment but lately we have started checking out filmmaking equipment to our youth participants. I was able to look at various templates and create a rudimentary checkout-checkin system in our eq base, but as of right now it doesn’t allow us to create EQ reservations for future dates.
I would like to be able to make EQ reservations (with multiple EQ items) for the future and see what EQ is “available” during a specific date range. So I would need these future reservations to be able to look and see what else is reserved or checked out in any given date range…
Im looking for ideas on how this could be possible, I have done a bit of research but haven’t found examples of what I am trying to do. Any help is greatly appreciated! thank you very much!
here is a link to a simplified test base version of our EQ base as an example for how we have it set up:
Jun 02, 2020 10:44 AM
I’ve written two scripts which may be of use to you. They both let people reserve something for a period of time, and only letting people reserve that something when it is available.
The first one:
I believe this should do exactly what you need: Ask who is making the reservation, ask for the date range of the reservation, allow someone to pick from a list of equipment only if the equipment hasn’t already been reserved for that date period.
My other script:
It more or less does the same thing, but is framed more as an “appointment scheduler” where people are reserving something for a period of hours and not a period of days. It is structured in a way that gives it a couple features/steps I don’t think you need or want, but I’m linking it here just in case there’s something in it you want incorporated that the first script doesn’t have.
Jun 02, 2020 10:55 AM
Thank you so much for your response @Kamille_Parks! I actually saw your script during my research and considered using it. The problem that i couldn’t figure out was how to reserve multiple items with out having to complete the script for each one individually. rather than reserving a single room or book or appointment, i am needing to reserve sometimes 5-10 pieces of equipment for each youth filmmaker for a given timeframe/reservation. Like Camera, lens, audio recorder, tripod, lights, etc. Do you have any ideas about that? Thanks!
Jun 02, 2020 11:03 AM
Right now the “select a record” inputs available to the Scripting Block and the Custom Blocks are only “single select”. I do have an idea though:
There could be an input field where the user is asked “how many assets are being reserved?” and then the script could create a loop showing a record-select input and have it run that number of times.
Or you could “hardcode” a maximum amount of items someone could reserve at a time. If you say the limit is 10, well the loop could run no more than 10 times, and on the 10th time tell the user “You’ve reached the limit”.
Lastly, just so you’re aware, with using scripts, they can’t really be shared by people who aren’t collaborators in that base. Until runable scripts can be publicly shared, either you or someone else on your team would have to run the script.
Jun 02, 2020 11:12 AM
Hmmm Ok i’ll try to mess around with that and see what happens. thanks for the ideas!
Jun 02, 2020 11:41 AM
Both suggestions would require replacement of let selectedAsset = ...
If I were to write it, I would replace that variable with an empty array like so let selctedAssets = []
. Personally, I’d go with the second option (set a maximum number of assets which can be reserved). Following that empty array would be a loop, something like:
for (var i = 0; i < maxAssets; i++) {
let asset = await input.recordAsync("Requested " + BaseSpecificNames.assetField + ":", availableAssets);
selectedAssets.push({id: asset.id})
}
Then of course in the await reservationsTable.createRecordAsync()
replace [{id: selectedAsset.id}]
with selectedAssets
.
This isn’t perfect. Ideally, with each run of the loop availableAssets
would re-filter to exclude the asset a person just clicked so people aren’t double-booking within the script itself. There’s some more error handling that would need to be incorporated with this new set up. I may tinker with this later today if I have the time.
Jun 02, 2020 12:29 PM
OK thanks for the details, let me know if you tinker with it again and learn anything new : )
I am also wondering if there is a way to do this without scripts?
Jun 03, 2020 10:46 AM
Hi OTF!
Aron from Airtable here. I quickly perused the base (seemed great!). The only thing that caught my eye was the “serial number” – you can use the barcode field to make it easier to find a piece of equipment (especially on mobile) by scanning the barcode.
I showed off what the barcode field can do in a recent webinar (recording here - the part on barcode is around 25 minutes in).
Hope that helps!
Best
Aron
Want to learn Airtable? Join me for a webinar at airtable.com/webinar
Jun 05, 2020 10:48 AM
Hey Aron! Thanks for your response :slightly_smiling_face: I love your idea about scanning barcodes however we aren’t set up to do that yet, we don’t have barcodes on all our items… One day that would be great!
My coworker said that she attended one of your webtrainings this week and said you were super informative and helpful! I’m wondering if you have any ideas for how to take the base I have set up and include the ability to make future reservations for equipment. right now ‘checkouts’ only works if you are checking out eq in the moment… I would like the ability to schedule to check out eq in the future as well. Any ideas or help is greatly appreciated! thanks!
Jun 05, 2020 09:46 PM
Well I figured out how to reserve more than one asset, without forcing a maximum asset limit (you know, other than the number of records available).
The approach is different than what I described above. Basically I have a variable shouldContinue
set to true
and a loop running until that value is changed to false
. Each time the loop run it has a new record picker, where the selected record is added to the selectedAssets
array and removed from the unselectedAssets
array (that way you can’t reserve the same record twice during this process). Then there are two buttons asking whether the loop should run again (select another asset) or should it end. If you click the “done” button shouldContinue
is set to false
and the process ends.
Then, like in the original script, it asks for confirmation that all the details are correct before adding the new reservation, now with multiple assets assigned to it.
Some other bits needed adjustment, like how unavailebleAssets
and availableAssets
are calculated as well.
Full code: