Validating amazon Time Slot

I am working on a schedule skill where I want users to be able to ask what happens at a particular time. I capture the time with the built in Amazon time slot. However comparing the query to the schedule times the if block always activates Option 1 (8:45 to 9:30) even if I ask for “12” or “noon”… I am wondering what is going wrong. Maybe my if block logic is faulty? I’m grateful for any ideas! Thanks :slight_smile:

I have never seen such expressions like “isGreaterThanOrEqualTo”…Does it work???

Also, Amazon.Time has some irregular returns.

Note that this slot also supports time-related utterances that map to a time period such as “evening”. This type of utterance returns a time period indicator instead of an ISO-8601 formatted time. For example, “evening” returns the value EV . The following time period indicators can be returned: night : NI , morning : MO , afternoon : AF , evening : EV .

Thanks for your reply! I have the expressions from so technically they should work… I can’t really make a custom slot because I would like users to be able to ask for any possible time. Thanks for the reminder about the time period indicators :slight_smile: I can try handling them specifically. But normally they should be handled by else, right?

I see. That seems only works in Alexa Developer Console, I think.

Actually, I’ve just tried comparing time in If block and have never succeeded :crazy_face::crazy_face::crazy_face:

Here’s document for Advanced Expression in If and Set block.

I wish VF will give us examples here.

Ahh too bad. Thanks for your help! And yes, that would be great

you can use code block and write some Javascript. put result into a variable and check and divide each flow in If block!

like this

code block like this.

if (time >= "00:00" && time < "06:00") {
  timePeriod = 1;
} else if (time >= "06:00" && time < "12:00") {
  timePeriod = 2;
} else if (time >= "12:00" && time < "18:00") {
  timePeriod = 3;
} else if (time >= "18:00" && time < "24:00") {
  timePeriod = 4;
} else {
  timePeriod = -1;
1 Like

just saw this! thank you kun :)!