How to write rules for entities extracted in forms

I am currently trying to set up a form for asking a user about their name. Originally, I just stored whatever the user typed in a slot, but then I realized that sometimes people type something like “Hi there, my name is John”. And I do not want to store that whole utterance in the slot.

So I thought to use entities, but I do not know if and how I need to adapt my rules to account for the fact that I am now extracting an entity through the user_name_intent intent. Any help would be very much appreciated!

So far, my rules just look like this:

- rule: start
  steps:
  - intent: hi
  - action: user_name_form
  - active_loop: user_name_form
  wait_for_user_input: false

 -rule: name
  condition:
    - active_loop: user_name_form
  steps:
  - action: user_name_form
  - active_loop: null
  - action: action_greet_with_name

And this is part of my domain.yml:

intents:
- user_name_intent

entities:
- user_name_entity:
    influence_conversation: false

forms:
  user_name_form:
    required_slots:
        - user_name_slot

 user_name_slot:
    type: text
    initial_value: ''
    influence_conversation: false
    mappings:
    - type: from_entity
      entity: user_name_entity
      conditions:
        - active_loop: user_name_form

actions:
- validate_user_name_form

I have also created a custom action to validate the form. And I have created some training examples for the user_name_intent in nlu.yml.

This post helped me get some things to work: Spacy and name entity in intent. So I actually did not have to change my rules - I just had to change my config.yml and my nlu.yml.