SmartAssist: Pass numbers to an entity

Hi,

I am build an experience flow which should:

  1. greet the user with welcome message
  2. ask “what can I help you with?” using conversational input
  3. use run automation to execute a specific usecase

All this works, the problem that I am facing is with an entity within that usecase.

It should prompt for an invoice number (123401). I say “one, two, three, four, zero, one” but when I look at the logs, the bot interprets it as “one, two, three, 401” and prompts an error.

What are the steps to overcome this issue?


In general the best approach here is to use the Number type entity and not a custom regex entity. The former is more appropriate for conversation, whereas a regex is programmer centric and is best limited to scenarios that require specific sequence patterns of letters and digits.

Now in your example, is a user really going to type in the commas, because a comma is typically a word separator and indicates that the elements either side of different things, a list of individual items? (Though in English numbers 123,000 can indicate thousands, and in Europe it represents a decimal point)

If the input was one two three 401 (without the commas) then a Number entity would interpret that as 123401 - a six digit number as you expect.

Hi Andy,

Thanks for your response. I do see now that I forgot to mention the most important point here. I am talking about a voice bot (SmartAssist). So, when you see “one, two, three, four, zero, one” this is user verbally spelling out the invoice number.

If I say “one hundred twenty-three thousand four hundred one” there is no issue at all but if I was to spell it out “one, two, three, four, zero, one”, that’s the where the problem is.

Well if you are using a voice channel, then a Custom regex is never going to be the appropriate entity.

For an utterance of “one, two, three” then is the ASR inserting those commas?
Because a user is never going to say “one comma two comma three”.

To the NL engine, everything comes in as text, and so “one, two, three” looks like a list of numbers, not a single number. Which means that if you cannot suppress the insertion of the comma then the entity needs to be multi-item, and you would have to use script to concatenate the elements together.