Create time-based availability status in Thunkable using Google Sheets

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!

Google Sheet:


Mobile UI:


Hi kongchichen00793frzt, welcome to Thunkable! :tada:

Be sure to check out How to ask Great Questions v2.0, the Community Guidelines, and our Getting Started Guide to make the best of your Thunkable Community experience!

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 followed your guidelines, but I still didn’t get the correct output for handling time conflicts. Could you kindly assist me further?:smiling_face_with_tear:

Here is the link to my project. Would you mind taking a look at it?
https://x.thunkable.com/copy/5c4b48dd5a43ed6e7f090d9b53b51b5b

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.