Creating a custom Entity

Developed with
Calculated Systems

Lab Steps

SIgning in to the Dialogflow Console
Creating an Intent in Dialogflow
Creating a custom Entity
Finalizing Your Intent
Capturing Additional Training Phrases
Setting up a Response
Trying Out Your Bot
Sneaking a Peak at the API
Need help? Contact our support team

Here you can find the instructions for this specific Lab Step.

If you are ready for a real environment experience please start the Lab. Keep in mind that you'll need to start from the first step.


Entities are objects within Dialogflow that can be used as parameters within Intents. Dialogflow comes with many predefined system entities but also allows you to expand the set to include user-defined options. In the previous step Dialogflow was incorrectly identifying your account number as a phone number. This is because Dialogflow does not know what an account number looks like! In this lab step, you will be creating a custom entity that captures the account number.


  1. Click Entities on the left hand side of the Dialogflow Menu.


    This will bring you to an empty Entity Creation Menu. This menu is where you manage the creation and definition of the Entities that will slot in as parameters.

  2. Click Create Entity in the top right corner.

    If the Create Entity button is greyed out ensure you have Custom and not System selected. Each entity needs a name that should be machine safe. That is because this entity will be passed to the back-end service in a production use case and will need to be parsed by code. This can make white spaces and special characters difficult at times.

  3. Name the entity account_number.

    Entities can have one of many configurations in order to find matches. In the case of account number, it follows the same pattern every time so Regexp Entity is a good option to get started.

  4. Click Regexp Entity. This will cause the checkbox to have a check and grey out Define Synonyms. The state of Define Synonyms as checked or unchecked does not matter.

  5. Where the dialog box days Enter Value copy in (\d{5,5}[A-Za-z]{1,1})


    You now need to save this entity and go back to complete our original Intent. The number of blank rows at the bottom does not affect behavior.

  6. Click Save.


In this lab step, you created a custom entity. Entities are useful to identify key parameters within an end-user query. Entities can be customized to match your application or draw from Google’s large library of pre-built ones.