# How to execute utter actions between slot filling of forms : ERROR rasa\_sdk.endpoint - Failed to extract slot email with action user\_info

**URL:** <https://forum.rasa.com/t/how-to-execute-utter-actions-between-slot-filling-of-forms-error-rasa-sdk-endpoint-failed-to-extract-slot-email-with-action-user-info/27389>\
**Category:** Rasa Open Source\
**Created:** [April 12, 2020, 8:36pm UTC](https://forum.rasa.com/t/how-to-execute-utter-actions-between-slot-filling-of-forms-error-rasa-sdk-endpoint-failed-to-extract-slot-email-with-action-user-info/27389 "2020-04-12T20:36:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![\_sanjay\_r](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/_sanjay_r/32/4451_2.png) [@\_sanjay\_r](https://forum.rasa.com/u/_sanjay_r)\
**Post date:** [April 12, 2020, 8:36pm UTC](https://forum.rasa.com/t/how-to-execute-utter-actions-between-slot-filling-of-forms-error-rasa-sdk-endpoint-failed-to-extract-slot-email-with-action-user-info/27389/1 "2020-04-12T20:36:50Z")

</div>

Hi Guys ,

I’m in the process of building my first bot. 🙂 I am using forms to extract **entites** ,_name_, _email_, _pincode_ and _mobile number_ and set them as **slots** ( of the same name ). They are handled by form **user\_info** in the same order.Then just simply return the names back to the user.

The bot is after initiating the form, extracts the name entity and sets the slot value. Then moves email. But here I am getting.

> ERROR rasa\_sdk.endpoint - Failed to extract slot email with action user\_info

> ERROR rasa.core.actions.action - Failed to extract slot email with action user\_info

I have ran the command :

> rasa run actions & rasa shell --debug

Please Find the logs below:

1.

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/1/1e15feaf93774cd5fb02ec2c59611d2860e4dc65.png) file:///home/sanjay/Pictures/Rasa\_log1.png user\_info

2.

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/1/1618c981caf387b74394732ce095884728a5b753.png) file:///home/sanjay/Pictures/rasa\_log2.png

3.

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/4/444f73a469fc7cb6ca3ab6a9a289f0c72bac3065.png) file:///home/sanjay/Pictures/rasa\_log3.png

4.

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/a/a3815abd9371c2eff6afbbb2b31dd859629fec8f.png) file:///home/sanjay/Pictures/rasa\_log4.png

5.

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/7/7650fccd206faa6f182f97d7c9dafc616d029957.png) file:///home/sanjay/Pictures/rasa\_log5.png

In the end the entities all the four entities(name, email, pincode, mob\_number) are extracted and I get the output too.

Please also find my files :

1. **nlu.md**

> ##intent: greet
> 
> - Hi
> - Hey
> - Hi bot
> - Hey bot
> - Hello
> - good morning
> - hi again
> - hi folks
> - hi Mister
> - hi pal!
> - hi there
> - greetings
> - hello everybody
> - hello is anybody there
> - hello robot
> - hi
> 
> ## intent:give\_name
> 
> - hey , this is Charlie
> - hello , Shyam here.
> - hi , I’m Ram
> - good morning , my name is Lucas
> - good evening , I’m Pedro
> - hey there , I am Todd
> - hi, my name is John
> - I am nick
> - Hey there , Brad
> - Bond,James Bond
> - Anand
> - Abhishek
> - Vivek
> - Marco
> - Joe
> - Praveen
> - Kevin
> - Anirudh
> - Arun
> - Rohith
> - Adithya
> - Jerry
> - Tom
> - my name is Peter Parker
> 
> ##intent:give\_email
> 
> - my email id is abc@xyz.com
> - my mail id is arun12@gmail.com
> - johnreeves37834@hotmail.com
> - my business mail is s\_Dibenedetto@Simpson.net
> - it is Carole@Hart.com
> - my email is Elinor\_Stock@Higgenbotham.com
> - my email is K\_Spivey@yahoo.com
> - my email is Kelly@Coulter.net
> - my email is M\_Jones@Luna.com
> - email id is Mia\_Gainey@gmail.com
> - my email is S\_Calderon@Cofield.com
> - my email is Virginia@Brown.com
> - my emayl is V\_Comley@Nelson.com
> - flowersblooms45@reddit.com
> - Mail id is Parker123@gmail.com
> 
> ##intent:give\_pincode
> 
> - 673032
> - my pin code is 120277
> - my pin code is 836602
> - my pin code is 474516
> - i am at 771044.
> - i stay at 547025
> - pin code is 342081
> - it is 635582
> - the pincode is 844004
> - pincode 458760
> - 123456
> - sure it is 905678
> - I live at 340001
> - I am located at 987511
> 
> ##intent:give\_mobile
> 
> - sure it is 9357724413
> - my contact number is 8075430831
> - my number is 7703486422
> - Contact me at 8089447356
> - it’s 9447567341
> - 8983617830
> - 9957314135
> - 8182367744
> - Yeah it is 9845518855
> - My mobile number is 9295671120
> - My cell is 8786858483
> - You can reach me at 7756993412
> - mobile number is 9296452144
> 
> ##intent:goodbye
> 
> - bye
> - goodbye
> - see you around
> - see you later
> 
> ## intent:affirm
> 
> - yes
> - indeed
> - of course
> - that sounds good
> - correct
> - ye
> - uh yes
> - let’s do it
> - yeah
> - uh yes
> - yes knocking
> - that’s correct
> - yes yes
> - right
> - yea
> - right on
> - i love that
> 
> ## intent:deny
> 
> - no
> - never
> - I don’t think so
> - don’t like that
> - no way
> - not really
> 
> ## intent:mood\_great
> 
> - perfect
> - very good
> - great
> - amazing
> - wonderful
> - I am feeling very good
> - I am great
> - I’m good
> 
> ## intent:mood\_unhappy
> 
> - sad
> - very sad
> - unhappy
> - bad
> - very bad
> - awful
> - terrible
> - not very good
> - extremely sad
> - so sad
> 
> ## intent:bot\_challenge
> 
> - are you a bot?
> - are you a human?
> - am I talking to a bot?
> - am I talking to a human?
> 
> ## regex:email
> 
> - \[1\]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,}$
> 
> ## regex:mob\_number
> 
> - [0-9]{10}
> 
> ## regex:pincode
> 
> - [0-9]{6}

1. **stories.md**

3. **domain.yml**

```
 session_config:
  session_expiration_time: 60
  carry_over_slots_to_new_session: true
intents:
- greet
- give_name
- give_email
- give_pincode
- give_mobile
- goodbye
- affirm
- deny
- mood_great
- mood_unhappy
- bot_challenge

responses:
  utter_greet_ask:
  - text: "hey there ,whats your name?"
  utter_did_that_help:
  - text: Did that help you?
  utter_goodbye:
  - text: Bye
  utter_iamabot:
  - text: I am a bot, powered by Rasa.
  utter_ask_name:
    - text: "Your name is?"
    - text: "What is your name?"
    - text: "Please tell me your name"
    - text: "Please enter name."
  utter_ask_email:
    - text: "Your email is?"
    - text: "What is your email id?"
    - text: "Please tell me your email id"
    - text: "Please enter email id."
  utter_ask_pincode:
    - text: "Your pincode is?"
    - text: "What is your pincode?"
    - text: "Please enter your pincode."
    - text: "Please tell me your pincode."
  utter_ask_mobile:
    - text: "Your mobile number is?"
    - text: "What is your mobile number?"
    - text: "Please enter your mobile number."
    - text: "Please tell me your mobile number."

actions:
- utter_greet_ask
- utter_did_that_help
- utter_goodbye
- utter_iamabot
- utter_ask_name
- utter_ask_email
- utter_ask_pincode
- utter_ask_mobile

entities:
  - name
  - email
  - pincode
  - mob_number

slots:
  name:
    type: unfeaturized
  email:
    type: unfeaturized
  pincode:
    type: unfeaturized
  mob_number:
    type: unfeaturized

forms:
  - user_info

```

4. **actions.py**

> from typing import Any, Text, Dict, List
> 
> ```
> from rasa_sdk import Action, Tracker
> from rasa_sdk.executor import CollectingDispatcher
> from rasa_sdk.forms import FormAction
> 
> ```
> 
> `class UserInfo(FormAction):`
> 
> ```
> def name(self) -> Text:
> """Unique identifier of the form"""
> return "user_info"
> 
> @staticmethod
> def required_slots(tracker: Tracker) -> List[Text]:
> """A list of required slots that the form has to fill"""
> return ["name", "email", "pincode", "mob_number"]
> 
> def slot_mappings(self) -> Dict[Text, Any]:
> return {"name": self.from_entity(entity="name",
> intent=["give_name"]),
> "email": self.from_entity(entity="email",
> intent=["give_email"]),
> "pincode": self.from_entity(entity="pincode",
> intent=["give_pincode"]),
> "mob_number": self.from_entity(entity="mob_number",
> intent=["give_mobile"])}
> 
> def submit(self,
> dispatcher: CollectingDispatcher,
> tracker: Tracker,
> domain: Dict[Text, Any]
> ) -> List[Dict]:
> name = tracker.get_slot('name')
> email = tracker.get_slot('email')
> pin = tracker.get_slot('pincode')
> mob = tracker.get_slot('mob_number')
> # utter submit template
> dispatcher.utter_message(
> "Hey, your name is {} , email id : {} , pincode is {} , maobile number is {}".format(name.title(),
> email.title(),
> pin.title(),
> mob.title()))
> return []
> 
> ```

5. **config.yml**

> ```
> language: en
> 
> ```
> 
> pipeline: supervised\_embeddings
> 
> policies:
> 
> - name: MemoizationPolicy
> - name: KerasPolicy
> - name: MappingPolicy
> - name: FormPolicy

6. **endpoints.yml**

> ```
> action_endpoint:
> url: "http://localhost:5055/webhook"
> 
> ```

It’s really wierd.I’ve been stuck on this for a long time. I saw Rasa Master class videos and searched the documentation and tried everything.Nothing seems to be working.

Is it because the training examples are less ?? or Am I missing something ?

PS: I am a total newbie, Please Help 😇.

* * *

1. a-zA-Z0-9.\_%±

---

<div class="post-metadata">

**Author:** ![\_sanjay\_r](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/_sanjay_r/32/4451_2.png) [@\_sanjay\_r](https://forum.rasa.com/u/_sanjay_r)\
**Post date:** [April 13, 2020, 2:58pm UTC](https://forum.rasa.com/t/how-to-execute-utter-actions-between-slot-filling-of-forms-error-rasa-sdk-endpoint-failed-to-extract-slot-email-with-action-user-info/27389/2 "2020-04-13T14:58:15Z")

</div>

Guys , update !

I am able to extract email now. What I did was use interactive learning to train and added new training data.

But now there is a new issue.

The form(user\_info) has to collect 4 entities ( **name** , **email** , **pincode** and **mobnumber** ) and fill the slots of same name.For each info there is an utter\_ask action to ask the user.

The form runnig smoothly till pincode and when it reaches mobnumber , it dosn’t run utter\_ask\_mobnumber. Instead it is an action\_listen.

I have tried interactive learnig as well. But it dosn’t seem to work.

Here is my github Repo 😇

> **[GitHub - sanjayrjs16/covid\_info\_bot: Simpe bot made with rasa to give info...](https://github.com/sanjayrjs16/covid_info_bot)**
>
> Simpe bot made with rasa to give info during covid pandemic. - GitHub - sanjayrjs16/covid\_info\_bot: Simpe bot made with rasa to give info during covid pandemic.

Could anyone please help out ??

**TL;DR**

It is a general doubt…

While a form is running, fetching entities from user message and filling slots , is there a way to control and specify what the bot will say next…

Eg:

> bot : What is your name ?
> 
> me: I am Reus.
> 
> bot: What is your email ?
> 
> Me: It [MR11HejaBvb@gmail.com](mailto:MR11HejaBvb@gmail.com)

> Bot: Pin code?
> 
> Me: 123456
> 
> bot:…

…

next is has to ask the mobile number…

The bot dosn’t execute utter\_ask\_mobnumber after I’ve provided pincode. That is the summary of the above problem.

---

<div class="post-metadata">

**Author:** ![Juste](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/juste/32/15_2.png) [@Juste](https://forum.rasa.com/u/Juste)\
**Post date:** [April 14, 2020, 9:16am UTC](https://forum.rasa.com/t/how-to-execute-utter-actions-between-slot-filling-of-forms-error-rasa-sdk-endpoint-failed-to-extract-slot-email-with-action-user-info/27389/3 "2020-04-14T09:16:36Z")

</div>

Hi @_sanjay_r. I just tested your assistant using the code you provided (thank you so much for this by the way, it makes debugging so much easier!), but could couldn’t replicate the issue. The assistant asked for all of the required slots and things worked well. You could try running rasa in a debug mode (when you run rasa shell, add the --debug flag) then you can see what your assistant does by the time it stops responding.

I have noticed though that you are not using components like duckling to extract the numbers from user inputs. It is not required, but duckling would make the extraction of the entities like pin, mobile number much more reliable. I doubt that it’s the case but it could be contributing to the issue you are facing a little bit.

---

<div class="post-metadata">

**Author:** ![\_sanjay\_r](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/_sanjay_r/32/4451_2.png) [@\_sanjay\_r](https://forum.rasa.com/u/_sanjay_r)\
**Post date:** [April 14, 2020, 6:57pm UTC](https://forum.rasa.com/t/how-to-execute-utter-actions-between-slot-filling-of-forms-error-rasa-sdk-endpoint-failed-to-extract-slot-email-with-action-user-info/27389/4 "2020-04-14T18:57:16Z")

</div>

Hi @Juste,

The problem was it didn’t work all the time.

I had seperated all intends based on entities they had like **give\_name** , **give\_email** , **give\_pincode** and **give\_mobnumber**

and one form **user\_info.**

I combined all the intents into one as **give\_info**.

That solved the issue. I guess the bot was getting confused. Now it works fine 🙂

Also , Thanks for the heads up regarding Duckling. I will try it. 🙂
