# Use of different forms based on the entity extracted

**URL:** <https://forum.rasa.com/t/use-of-different-forms-based-on-the-entity-extracted/23460>\
**Category:** Rasa Open Source\
**Created:** [January 13, 2020, 10:11pm UTC](https://forum.rasa.com/t/use-of-different-forms-based-on-the-entity-extracted/23460 "2020-01-13T22:11:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![shanub](https://avatars.discourse-cdn.com/v4/letter/s/e0b2c6/32.png) [@shanub](https://forum.rasa.com/u/shanub)\
**Post date:** [January 13, 2020, 10:11pm UTC](https://forum.rasa.com/t/use-of-different-forms-based-on-the-entity-extracted/23460/1 "2020-01-13T22:11:36Z")

</div>

My requirement is,

User : hello

RasaBot : hello, what service you want?

User : restaurant

RasaBot : Provide the number of people ,time and cuisine.

User : For 4 people, at 7PM , mexican cuisine.

RasBot : booked this resaturant ABC…blh…blah…

===========

User : hello

RasaBot : hello, what service you want?

User : movie

RasaBot : Provide the number of people ,time and theatre preference

User : For 4 people, at 7PM , XYZ theatre.

RasBot : booked this movie show blah,blah,

====================

User : hello

RasaBot : hello, what service you want?

User : haircut

RasaBot : Provide me the time

User : for 7 pm

RasBot : booked this salon at 7 PM…blah…blah…

=============

As you can see, based on the first entity response, bot should ask different set of questions(form)…how do we achieve this?

---

<div class="post-metadata">

**Author:** ![Tanja](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/tanja/32/4696_2.png) [@Tanja](https://forum.rasa.com/u/Tanja)\
**Post date:** [January 14, 2020, 7:19am UTC](https://forum.rasa.com/t/use-of-different-forms-based-on-the-entity-extracted/23460/2 "2020-01-14T07:19:00Z")

</div>

You should be able to write your stories like this:

```auto
# Story 1: Restaurant Service
* greet
  - utter_ask_service
* request_service{"service":"restaurant"}
  - restaurant_form

# Story 2: Movie Service
* greet
  - utter_ask_service
* request_service{"service":"movie"}
  - movie_form

...

```

The intent `request_service` captures the name of the service the user wants to use. You will have an entity and a slot called `service`. Make sure to have some examples in your NLU data that define, for example, “restaurant” as `service`. Depending on the `service` entity that was found, Rasa will pick up the correct form. Add `MemoizationPolicy` and `FormPolicy` to your policies in your configuration file.

Does that help?

---

<div class="post-metadata">

**Author:** ![Tanja](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/tanja/32/4696_2.png) [@Tanja](https://forum.rasa.com/u/Tanja)\
**Post date:** [January 14, 2020, 10:03am UTC](https://forum.rasa.com/t/use-of-different-forms-based-on-the-entity-extracted/23460/3 "2020-01-14T10:03:23Z")

</div>

Forgot one thing: `service` slot should be categorical and then you should have the slot event as well. By default featurization of entities in intents is only based on whether or not a certain entity is extracted, so the actual entity value won’t change the dialogue history unless thrown into a categorical slot.

---

<div class="post-metadata">

**Author:** ![12bambat](https://avatars.discourse-cdn.com/v4/letter/1/b5a626/32.png) [@12bambat](https://forum.rasa.com/u/12bambat)\
**Post date:** [January 16, 2020, 4:38pm UTC](https://forum.rasa.com/t/use-of-different-forms-based-on-the-entity-extracted/23460/4 "2020-01-16T16:38:08Z")

</div>

Great To Read[😍](http://topweedkiller.com/) Regards William
