Sunday, 11 June 2017

How to validate phone number in bot framework?

I'm using following code to get user input for a phone number. I want to validate user input and if it is incorrect, need to ask the user to enter again.

[function (session, results, next) {
    builder.Prompts.text(session, 'I will also need to know your contact number.');
}
,function (session, results, next) {
    session.userData.contactNo = results.response;
    next();
}]

I tried this example, but it gives a warning saying it is deprecated. Appreciate any help regarding the correct way to do this(without using the deprecated method). My phone number regex is ^[689]\d{3}\s?\d{4}$



via Channa Somathilaka

No comments:

Post a Comment