Could someone teach me how to create a function in Thunkable that checks whether the current time is between a start time and end time stored in Google Sheets? If the current time falls within this range, the phone’s UI status should display “Unavailable”; otherwise, it should display “Available”. I would greatly appreciate it if you could provide the coding for this. Thank you very much!
This can be a bit tricky as you’re dealing with time but you’ve got the psuedo code pretty correct. You’ll want to use the comparison blocks and an if/else statement to check if the current time falls within the range of times. If the current time value is greater than the start time but less than the end time, you’ll set a label to Available, else you can set it to Unavailable.
I would either compare the times in the Google Sheet using a formula or I would convert both times to Unix timestamps and compare them as numeric values.
hi, how to convert both times to unix timestamps and compare them as numeric values?
im still learning through thunkable.
could you kindly assist me further?
actually, i want my thunkable to show error when someone book the meeting room that is already booked by other staff. this validation should be through the time of booking (start date, start time and end date, end time)
You can do this using the Javascript Web Bridge. You would need to find a javascript that does this or have ChatGPT (or another LLM) create one for you. I don’t recommend doing that if you’re not already familiar with that process. I would do the time comparisons in the Google Sheet directly.
As far as checking if a meeting room is reserved, you’ll have to think through how to do that and come up with an algorithm/pseudocode and work through it step by step. It’s complicated. I would personally use ChatGPT to figure that out.