I am using the Architect Bot flow to check the differences between 2 dates.
I would to be able to manage datetime slot but in the builtin list this one doesn't appear.
I'm using date format now and it's able to manage time too (if user types "2 hours ago" in the chat), but if I try to extract the hour by the slot in some decision block in the Architect Bot flow, no one function (es. Hour()) accept a date slot as an argument.
I'm sure that DateTime slot could resolve this problem, but how can I choose this slot type if it isn't in the slot type list?
At the moment I'm using a Date slot.
In the ask slot, the question is "when, more or less, was the document inserted?"
When the user types:
"6th april" -> I would to get "6th april 2022" instead of "6th april 2023" (today is 8th april)
"yesterday" -> I would to get "7th april 2022" (and this happen)
"5 hours ago" -> I would to get "8th arpil 2022 10:00:00" instead of just the date
I must to check some logic on the hours, if specified.
in a decision block, using the Date slot, when I try to do something like this: Hour(Slot.insert_date)
the error says: 'hour' at position 1 : There is no implementation that accepts a parameter of type Date.
In the Documentation (here), exits a DateTime type slot (builtin slot type), but in my Italian language UI, I'm not able to find it when I create a new slot
Using Hour(ToDateTime(ToString(Slot.SomeDate)))
and setting Slot.SomeDate as 12th april 10:00:00, the result is 0 and communicating the slot, the result is just "12th April 2022"
DateTime is not supported as a builtin type. Only separate builtin:date and builtin:time entity types are available. And as you have seen a builtin:date slot will not resolve with a time.
So if I now understand your problem correctly, you want to perform different actions based on the hour if a user specifies today's date. If not today's date then the time doesn't matter.
Preferably you would like to do this in one operation if the user uses a phrase that provides both date and time, but unfortunately, I don't think this is possible at this time.
What we could do is check that the date the user provided is today's date and then ask them for the time. Would this satisfy what you are trying to achieve?
We could do this using a decision node with the evaluation expression like follows: AreEqual(Slot.insert_date, ToDate(GetCurrentDateTimeUtc()))
I am not sure DateTime will correct this. I can see you are trying to ask for a date before the current date. Right now Date assumes the year is the one after the current time if it has passed. This is the case where you say 6th April as it assumes it is the future and never the past. This is know based on the NLU used and DateTime would do the same thing.
For your use case, do you need the time they submitted the document or just the date?
I need what Kevin said: I want to perform different actions based on the hour if a user specifies today's date. If not today's date then the time doesn't matter.
The first example, should be a plus: I understand that date (and datetime too) performs in that way; It should be cool to be able to choose which year returns when it is not specify by users, not next year automatically because 6th April is in the pass (because in my question, i should use in the current year not in the future one).
I forgot to mention that the best place to post any changes you would like to see to the system on https://genesyscloud.ideas.aha.io/ideas. They're viewed by our product managers etc and feed into our future release plans.