Hello Glide community,
I have a scenario where I need to create a class with specified class sessions, days of the week, and a starting date. For instance, I might need to create a class with 10 sessions that occur on Saturdays, Mondays, and Fridays, beginning on 01/01/2023.
Additionally, these class sessions need to take into account holidays, so no sessions occur on those dates. To manage this, I have a Google Sheet which lists the holiday dates that need to be avoided.
To solve this, I’ve created a Google Apps Script, deployed as a WebApp. This script receives a
doPost request from a Glide app webhook. The post request includes the starting date, the days of the week for the sessions, and the session count. The script checks these against the holiday dates in the Sheet, populates the class sessions while skipping holidays, and appends these sessions to the appropriate sheet.
Thanks to chatGPT I managed to get the code in short time but my question is:
Is there a simpler way to accomplish this task within Glide? Or is my current solution the most effective method given the requirements?
Thank you for your input!
I think it’s quite a complex set of requirements, is it basically navigating sequentially through each date and determining if that is a holiday, if not add it to the list, else go to the next date until you fulfill all sessions?
If your Apps Script work, I would keep it. There might be a way to do it completely within Glide, combining with Make for the loop, but it might still be as complex as your current solution.
Agree with @ThinhDinh. It could be done with a Glide Helper table and a bit of computed column logic, and then use Make to add rows via the API. But that wouldn’t necessarily be any simpler. If you already have a working solution then you may as well keep it. “If it ain’t broke…”
Yes, the process starts with a specific starting date. It then examines each subsequent date, verifying whether the date falls on one of the specified days of the week. If it does, the process further checks to ensure the date is not listed as a holiday. If the date passes both these checks, it’s added to the session list. This process continues, with the date incrementing each time, until it reaches the specified total session count. Thank you for your suggestion regarding the use of Make however I think it is still not natively implemented in Glide when using Make
Yeah that’s true. You have to add separate rows, sequentially, and that’s not able to be natively done for now.