Search code examples
formatentitydialogflow-esspecificationsphone-number

Dialogflow - Phone Number Specification (@sys.phone-number)


In Dialogflow, when using @sys.phone-number as an entity type, what specification is the query expected to follow in order for part of it to be mapped to that entity parameter?

Suppose I have an entity called generic_phone_number with the entity type being @sys.phone number. 1 (800) 555-6666, (647) 888-9999, and 5556667777 do get parsed correctly, but not 555.666.7777.

For numbers that don't follow the specification, can Dialogflow itself parse them to formats that the entity will hold them?


Solution

  • You may take the help of Regex as shown in this example. You can set a pattern and in the webhook check if the number matches your requirement else ask for input again. You may also be required to capture this using @sys.any or some other combinations.