Create a time bucket

Hi,

I am new to app sheet. I am creating an app for campaign scheduling.
In a form view, I have a column of type Time called Schedule Time and it lets user to select time however, I need to limit user input so that they can just select time between 10:00:00 PM until 6:00:00 AM. I used this expression AND([schedule_time] >= โ€œ22:00:00โ€,[schedule_time] <= โ€œ06:00:00โ€) in Valid If formula but it is not working and I donโ€™t understand why it gives date value.

ALL these statements are true:
โ€ฆ1: (The value of column โ€˜schedule_timeโ€™) is greater than or equal to (โ€œ12/30/1899 10:00:00 PMโ€)
โ€ฆ2: (The value of column โ€˜schedule_timeโ€™) is less than or equal to (โ€œ12/30/1899 6:00:00 AMโ€)
what does these 12/30/1899 means???
How can I implement it in AppSheet?

0 2 258
2 REPLIES 2

Could you elaborate your requirement further? Will the entry restricted to just one timeframe , such as 1st November 22:00:00 hrs to 2nd November 06:00:00 hrs or are these entries open for user for several days?

The time expression comes with a default date. Even otherwise your time expression is likely to fail because it sounds that your start time is on the previous date night and the end time appears to be on the next date.

Also, when more records are accumulated in the table, a time entry of say 22:40:00 in two different records will need to be further qualified by date.

So you may wish to use a datetime type of column for schedule time instead of just time type column.

Based on your requirement the valid_if can be further qualified.

Sorry, looks like my initial example was problematic which caused the main question to be vague.
I have a separate field to capture frequency which can be selected at โ€œDailyโ€. Then I want another field to capture time (of the day), for which I can use type Time. However, type Time will by default render full spectrum for choosing hour, minute and AM/PM. My requirement is that the entered time by the user must not be outside a certain window of time (in my case I want to only accept a time between 10pm and 6am the next day). As you mentioned, I should be able to do this by using valid_if. Here is the issue: as per the documentation of pattern โ€œ{HH:MM:SS}โ€ should give a Time variable (see attached). Or even from this document (here), TIME(โ€œ3:14โ€) should produce a Time variable. But when I use these, I will also get the default date โ€œ12/03/1899โ€, which then causes issues with my comparison: i.e. when I use formula:
AND([schedule_time] >= โ€œ22:00:00โ€, [schedule_time] <= โ€œ06:00:00โ€), in which [schedule_time] is the Time field mentioned above, then I wonโ€™t get the desired outcome I need => all inputs of [schedule_time] will generate a validation error!
I hope I have now clarified the problem a bit more and thank you very much for helping me out.

Top Labels in this Space