How to write intent of an agent where date is essential parameter? - dialogflow-es

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.

Related

How to validate the days based on the month input from the user dialogflow

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

DOB field as date tab prompts date picker

I have a date field and it has to be a date field as I need to run formula on the field to identify is the person is over 18 or not. Formula field is to find if dob is 18 or over. And date formula's does not work on text field.
Now the issue is, because it is a date field, docusign prompts date picker and any date format I provide either through validation or by changing the regional setting does not change the date format. It is always 2021-06-24T12:00:00-04:00 (ie YYYY-MM-DDTHH24:MI:SS).
Date tab gets added using API and so are the validationPattern. Please can you help me with the following issues.
How can I stop the date picker from showing?
Even if the date picker shows up, how to control the date format. I am looking for mm/dd/yyyy
Regional settings, Time Zone does not have a Date format without timestamp. Inspite of picking something from there, date picker does not match what was picked.
Update, you can use formulateTab to calculate the date in 18 years like this:
AddYears( [Text <GUID>] , 18)
Note above is the unique ID of the text tab where the user enters their DOB.
Hope that helps.
Make it into a text field and you can then just use Date validation with one of the formats below: (make sure it works for you first from the web app - you can later do this all with the eSign API)

I want to print only date not time after using #sys.date without using webhook in dialogflow

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"

DialogFlow parameter reprompt after validation

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.

Orders on 2 sheets and new order confirmation change followup

How can I check whether order confirmations has changed from last weeks report?
I get an weekly report with orders (order number:x123) and confirmations(dates) and they are on different sheets.
What I would like to do is: With Vlookup, Find the corresponding order and print out word "old order" and then use this value to check the confirmations dates match per last week and print out "match" or " do not match".
I thought this was simple but I cant get it to work. Please help!

Resources