# Get name from intent and reply it in the action

**URL:** <https://forum.rasa.com/t/get-name-from-intent-and-reply-it-in-the-action/13354>\
**Category:** Rasa Open Source\
**Created:** [July 23, 2019, 4:59am UTC](https://forum.rasa.com/t/get-name-from-intent-and-reply-it-in-the-action/13354 "2019-07-23T04:59:48Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![dushandevinda](https://avatars.discourse-cdn.com/v4/letter/d/f08c70/32.png) [@dushandevinda](https://forum.rasa.com/u/dushandevinda)\
**Post date:** [July 23, 2019, 4:59am UTC](https://forum.rasa.com/t/get-name-from-intent-and-reply-it-in-the-action/13354/1 "2019-07-23T04:59:48Z")

</div>

Hi, i’m new to rasa and i’m trying a simple chatbot. In my case, i want to get the name of the person who chat and then provide the reply action with his name. An example is given below.

Me - Hi i’m Dushan

RasaBot - hi Dushan, How are you

Something like above.

---

<div class="post-metadata">

**Author:** ![tonysinghmss](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/tonysinghmss/32/5846_2.png) [@tonysinghmss](https://forum.rasa.com/u/tonysinghmss)\
**Post date:** [July 23, 2019, 5:23am UTC](https://forum.rasa.com/t/get-name-from-intent-and-reply-it-in-the-action/13354/2 "2019-07-23T05:23:07Z")

</div>

Dushan you can easily make such a bot by reading [https://rasa.com/docs/rasa/](https://rasa.com/docs/rasa/).

You want your name (entity ) to be extracted from your greeting sentence( or greet intent). So create the `stories.md` and `nlu.md` accordingly. Then train your rasa model on it. After that, it will be able to reply the way you want it to.

---

<div class="post-metadata">

**Author:** ![dushandevinda](https://avatars.discourse-cdn.com/v4/letter/d/f08c70/32.png) [@dushandevinda](https://forum.rasa.com/u/dushandevinda)\
**Post date:** [July 23, 2019, 5:43am UTC](https://forum.rasa.com/t/get-name-from-intent-and-reply-it-in-the-action/13354/3 "2019-07-23T05:43:34Z")

</div>

can you please tell me the exact location to follow. Right now i’m looking at many document pages and some samples. If you can give me an exact location, it would be great. Btw i got a clue that i can use slots.

---

<div class="post-metadata">

**Author:** ![msamogh](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/msamogh/32/3478_2.png) [@msamogh](https://forum.rasa.com/u/msamogh)\
**Post date:** [July 23, 2019, 8:49am UTC](https://forum.rasa.com/t/get-name-from-intent-and-reply-it-in-the-action/13354/4 "2019-07-23T08:49:51Z")

</div>

You’ll need to do the following:

1. Write NLU training data to detect intent and entities
2. Add a slot with the same name as the entity (in your case, `name`)
3. Define a story where the user entering their name is followed by an `utter_greet` or something
4. Define `utter_greet` in the domain file to be a template utterance (something like `Hi {name}, how are you?`)

---

<div class="post-metadata">

**Author:** ![dushandevinda](https://avatars.discourse-cdn.com/v4/letter/d/f08c70/32.png) [@dushandevinda](https://forum.rasa.com/u/dushandevinda)\
**Post date:** [July 23, 2019, 9:56am UTC](https://forum.rasa.com/t/get-name-from-intent-and-reply-it-in-the-action/13354/5 "2019-07-23T09:56:19Z")

</div>

hey, thanks a lot @msamogh It worked 🙂

---

<div class="post-metadata">

**Author:** ![tonysinghmss](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/tonysinghmss/32/5846_2.png) [@tonysinghmss](https://forum.rasa.com/u/tonysinghmss)\
**Post date:** [July 23, 2019, 12:37pm UTC](https://forum.rasa.com/t/get-name-from-intent-and-reply-it-in-the-action/13354/6 "2019-07-23T12:37:09Z")

</div>

@msamogh has explained it very nicely in a step by step manner.

---

<div class="post-metadata">

**Author:** ![crystaltaggart](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/crystaltaggart/32/4090_2.png) [@crystaltaggart](https://forum.rasa.com/u/crystaltaggart)\
**Post date:** [July 23, 2019, 1:51pm UTC](https://forum.rasa.com/t/get-name-from-intent-and-reply-it-in-the-action/13354/7 "2019-07-23T13:51:22Z")

</div>

Can you provide an example on the first step here? I tried using a regex pattern but it’s not detecting the name. I ended up training about 60 names and that ended up working. It seems like this should be simpler.

---

<div class="post-metadata">

**Author:** ![msamogh](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/msamogh/32/3478_2.png) [@msamogh](https://forum.rasa.com/u/msamogh)\
**Post date:** [July 23, 2019, 2:56pm UTC](https://forum.rasa.com/t/get-name-from-intent-and-reply-it-in-the-action/13354/8 "2019-07-23T14:56:03Z")

</div>

@crystaltaggart Could you post this as a new question? 🙂

---

<div class="post-metadata">

**Author:** ![msamogh](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/msamogh/32/3478_2.png) [@msamogh](https://forum.rasa.com/u/msamogh)\
**Post date:** [July 23, 2019, 2:56pm UTC](https://forum.rasa.com/t/get-name-from-intent-and-reply-it-in-the-action/13354/9 "2019-07-23T14:56:13Z")

</div>


