I have an intent where bot is asking for date to the user. The users might say today, last week, last monday etc.
If the user is saying things like last week or last month (basically things which cannot be converted into an exact date), then bot should prompt again please enter exact date to proceed.
Case 1: taking #sys.date
I have marked this entity as required and set prompt please enter the date, now every time user is saying last week, it is not being detected by #sys.date and user is getting same prompt again and again.
Case 2: taking #sys.date-time
If i take #sys.date-time i am able to get all kind of inputs.
If user said last week, last months etc then I will get startDate in parameter value, if user said today, there will be direct value in parameter.
This can be processed in webhook for slotfilling as well, we can set parameter value to null and invoke same intent again by I am not able to figure out how to set different prompt
params = req['queryResult']['parameters']
date = params['date']
if 'startDate' in date:
print('inside startDate')
res = json.dumps({
'followupEventInput' : {
'name' : 'e_date',
"parameters": {
"date": '',
}
}
})
By above code, intent is triggered again but prompt is again same which we have set in DialogFlow console.
I had to take #sys.date as entity because it offers date.recent option which is suitable for my use case, by taking #sys.date-time or #sys.date-period the date DialogFlow is catching is not correct. For example if today is tuesday and user said last monday then Dialogflow will catch monday of last week, not the most recent monday. And there are many cases like this if we are not taking date.recent
I recommend to create a other intent having training phrases like: last week or last month. Then have this response prompt the user to be more specific on a date.
Related
I have created a bot in dialogflow that gets firstname ,lastname, dobyear, dobmonth ,dobday from the user. I want to validate the days in terms of the month I get from the user in webhook nodejs. Example:
bot: enter yourdob -month
user: 02
bot: enter yourdob-date
user:31
bot:enter yourdob-year
user:1994
bot:This is invalid date.
I tried this method below,but did not work.
Well as I see, you can get the number of days that are in the month you provide, then compare with the number that the user put and get set the response depending if the number exceeds or covered
user phrase - I want to travel on 14th jan 2020.
response - so, you want to travel on 2020-01-14T12:00:00+05:30
here, I want to response as follow -
response - so, you want to travel on 2020-01-14
I don't want to use dialogflow.
Are you sure you are catching a #sys.date entity and not a #sys.date-time ?
According to Dialogflow System Entities Documentation #sys.date should return:
#sys.date matches common date references such as "January 1, 2015" or “The first of January of 2015” and returns a reference value in ISO-8601 format: "2015-01-01"
I am new to DialogFlow and developing an agent which gives year wise information.
The intent named as YearData and following phrases are used for training
1. "year wise report"
2. "Annual report of 2017"
3. "where i can find annual report"
and i have set parameter name date-period as required now when i am giving the year 9999 its showing the same response for 2017 or 2018. I want to limit it to a valid date
When a user give invalid date ..the system should prompt that date is not valid or not in the range
In your fulfillment webhook, check to make sure it is a valid date and, if not, send back a message saying so.
We have SharePoint list to register the employee sick absence, the HR user sometime register duplicate absence or in the within the same absence period for the same employee, example the following record :
Name : Tony
ID :400
Sick Leave start_date 3/27/2018 AM
Sick Leave end_date 3/29/2018 AM
Total days : 3
per the example by mistake the HR user add new sick leave for tony on 3/28/2018 without he notice he already take a leave from 3/27/2018 to 3/29/2018 .
So the question How we can add validation to restrict adding record in the same absence period
You could use PreSaveAction to do client side custom validation,so you could use REST api or JSOM to query whether user has apply a request already, when return false, the list item won't save.
Check the sample here
Is there a way to make "date and time" column in SharePoint so it will behave in this way:
-if date that is entered in that column is today, tomorrow that column will be empty.
To explain it a lil' bit better, lets put it this way:
That column is reservation column. User enters the date on which he will stop doing something:
column_1-column_2-column_3-RESERVATION_COLUMN
If today is 01.01.2012, and I will be doing something till 05.01.2012., I will enter "05.01.2012." in RESERVATION_COLUMN". When that day comes, or the day after it (isn't really mather) that column will be empty.
I tried some ways, but I didn't succeed. Any help?
Thanks in advance,
K.
Only way I can think of is using a workflow.
Using workflow -> Wait till day + 1 then Set field value to blank.
also you can create TimerJob, which will be executed one or few times per day.
This timer job will query list items with your parameters, like items, where in the date field is value equals today or less then today. Then TimerJob will iterate and update this field.
Other, more difficult way is to write your own custom datatime field with specific behavior.