List businesses open "now"

This is brilliant !

1 Like

I’ve been experimenting with your solution, but can’t for the life of me figure out how you get the “before now” and “after now” data into the filter fields. I’m probably missing something obvious… thanks for posting your solution, I hope I can get it to work :slight_smile:

Make sure you’re filtering on a datetime column. Does Glide read that column as datetime, or somehow it’s read as text?

Sometimes glide won’t automatically recognize the type of column. Especially if the first row or possibly other rows don’t contain any data in that column. If necessary, you could create a new column in Glide, but specify it as a date column. It will also create it in the sheet. Then switch over to using the new column.

But overall, what @ThinhDinh is saying makes sense. You might not be getting the date compare options because your column isn’t being seen by glide as a date column

1 Like

In my copy of @Jeff_Hager’s app, the columns show up as “text” in the Glide data editor:

The filter works in the copy of his app, but even there I don’t get the time options (before, after, etc.) in the filter popup if I try to edit it. Bug?

I’ll try to take a look later today to see how I have it set up.

1 Like

Ok - Glide just didn’t copy the column formats along with the copy of the app. I created new columns in the Glide editor set to Date/Time and then copied the data over in the Google spreadsheet. That fixed it for me. Thanks for the help!

2 Likes

I took a look at my copy. I’m guessing that maybe when you copied it, ‘Closed’ was showing in the column, so it wasn’t initially recognized as a date column.

I got this working perfectly and then found out that I have a bunch of use cases that I can’t figure out how to implement. There are multiple businesses that are open in discontinuous hours – e.g., for breakfast, lunch, dinner, etc., with gaps in between when they are closed. I spent the better part of a day trying to come up with a scheme to address this, but it got away from me.

Any thoughts on how to build this? Or can anyone recommend an expert who might be interested in building this as a work-for-hire?

I would probably just duplicate all of the columns, so the first set would be Breakfast, the second set Lunch and the third set Dinner. Maybe using different visibility, you could display different or multiple tables that show the hours.

Hello – Thank you @Jeff_Hager for the examples - very helpful! I’m too looking for the solution where businesses open on the same day on different times (i.e. 9-11am and then 5-8pm) - I took a shot at this without success thus far :frowning: – any thoughts? thanks!!

:wave: Hello All :slight_smile: – I actually made this work: https://lacc-poc.glideapp.io/ --> as usual, there might be a way of making it simple® with less code, but hey - it’s working :smiley: :vulcan_salute:

1 Like

Hello again - (FYI: I’m new to glide and still discovering it) – this somewhat makes me perplexed: out of blue, two out of four columns that initially were formatted as date, now are shown as boolean and cause to break the calculation of “Open Now” - is this a common thing in glide? Last night I checked and all seemed fine - this morning I have boolean … – thoughts? Thank you!
Screen Shot 2020-08-25 at 08.10.44

What are the values in that column in your sheet?

I also found that Glide keeps changing the column formats from Date/Time to Text on its own, so the calculations break. Even when I create a new column in the data editor as Date/Time, it eventually switches to being just text. It does not like the arrays. (I have t seen it switch to Boolean on me… yet!)

This is way too unreliable, so I switched to doing all the calculations in the sheet rather than with Glide columns. That works fine with a Pro account but won’t work for a free app.

@ThinhDinh - hello: thanks for prompt response!
it was however my oversight - had an error in array formula AND there might have been a lag in updates between my sheet and glide - I think it’s fixed now

2 Likes

The column type depends on what you have in the Sheets. Are you sure your column contains actual datetime value?

1 Like

it was a silly mistake - proves how important is to pay attention to details :slight_smile:
The formula had typo and that caused the answer to return “FALSE” thus making it boolean… :slight_smile: - it was my mistake repeating the same week # 7x IF(WEEKDAY(NOW()) = 2 instead of 1,2,3… etc. – thanks for following up!!!
here is the corrected formula I used:

2 Likes

Hello - please advise as I’m not sure what I’m dealing with here:

The arrayformula (as used initially in @Jeff_Hager solution) works smooth in google sheets, recognizing IF(WEEKDAY(NOW()) = … however on the app-side (data view), that column does not refreshes automatically causing the entire calculation to break…

in other words: I checked the app today, August 29 – the google sheets correctly shows todays date, however on the app-side in data the rows are “stuck” at August 27…

I’m guessing this has something to do with the background refresh, which is “natively available” only in pro apps – am I correct?

That would be correct. It’s not going to update automatically, unless you are using the background refresh pro feature. Your app would either need background refresh or some type of input from the app that would cause it to resync with the Google sheet. The NOW() function in Google sheets is part of a handful of functions called Volotile functions. They will not automatically update and resend data to glide with updates. They need some sort of input or interaction with the sheet before they will update. It’s complicated to explain, but there is info out there about it.

My solution was also developed before many current features were available in glide, so it might be possible to build more of this within glide now.