This is the 9th in a series of posts “Must Know Features of Dialogflow”. Here we take a look at the wildcard entity.
We will use the wildcard entity in template mode, and we declare training phrases which include the wildcard.
The wildcard entity allows us to match anything the user types and store it into an entity value.
Some uses of the wildcard entity:
- when you need to handle entities not supported by Dialogflow (e.g. ISBN numbers), you can collect the entire input using the wildcard entity and extract the number using regex in your webhook
- I have written an article explaining how you can use the wildcard entity to handle cuss words (advanced article)
Important: don’t use the wildcard entity alone (in other words the training phrase contains only the wildcard entity and no other words) in a training phrase unless the intent has an input context set. Otherwise it will match all inputs (advanced article) and do so in unpredictable ways.