Best slot type for collecting an account number in a Lex bot

0

I'm working on a Lex bot to accept a caller's spoken account number (9-12 digits) and 4 digit PIN. And while Slot type AMAZON.FOUR_DIGIT_NUMBER works great for the PIN, I'm running into difficulties with the account number. Slot type AMAZON.NUMBER sometimes works. But I've also been cut off in the middle of speaking the account number. For example, it will sometimes cut me off after speaking only 5 numbers - and it's not because I'm pausing or anything.
Is there any way to specify that it should listen for at least 9 digits, and no more then 12?

mhal20
asked 4 years ago1146 views
1 Answer
1

Found the answer:
Add new slot type,
Extend slot type (extends AMAZON.AlphaNumeric using a regular expression),
Enter expression: [0-9]{9,12}
Which restricts input to numbers 0-9, min length 9, max length 12

mhal20
answered 4 years ago

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