How can we validate date in Amazon Lex?

0

I have created a Hotel Management lex bot that makes a reservation for hotel rooms. I am using slots (Check-in Date and Check-out Date). I am using a built-in slot that is Amazon.Date.

Problem

I want to restrict customers at this stage so that customers can only enter date that matches with the current date or after the current date. Currently, these slots are accepting all dates including previous dates.

How I can validate these slots? (Can we solve our problem with RegEx while using Amazon.Alphanumeric type)

What are the possible solutions?

Should we handle this in Lambda? (If yes, kindly describe how I can get the Elicitation value of a slot in Lambda (Python)).

What would you prefer me to resolve or achieve this?

Any help would be greatly appreciated and thanks in advance.

1 Answer
1

Yes you are correct, you would need a Lambda handler for the custom validation. This example is very similar to your use case.

https://docs.aws.amazon.com/lex/latest/dg/ex1-sch-appt.html https://docs.aws.amazon.com/lex/latest/dg/lex-lambda-blueprints.html

You should be able to reuse most of the code in these examples and just have to make some minor customisations.

Hope this helps.

Kishan
answered 2 years ago
  • Can you tell me where is the lambda code? The links you have shared, have no lambda coding that can help me.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions