# How to create story base on a catgory slot value

**URL:** <https://forum.rasa.com/t/how-to-create-story-base-on-a-catgory-slot-value/46532>\
**Category:** Rasa Open Source\
**Created:** [August 4, 2021, 4:26pm UTC](https://forum.rasa.com/t/how-to-create-story-base-on-a-catgory-slot-value/46532 "2021-08-04T16:26:50Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kosechok](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/kosechok/32/12803_2.png) [@Kosechok](https://forum.rasa.com/u/Kosechok)\
**Post date:** [August 4, 2021, 4:26pm UTC](https://forum.rasa.com/t/how-to-create-story-base-on-a-catgory-slot-value/46532/1 "2021-08-04T16:26:50Z")

</div>

can anyone describe in a two words, how can i create a story based on a category slot value? for example i set a slot in a previous conversations or in action via api (i can call external api and get a value for a slot) and now I have a slot value but i can’t understand how to “fired” necessary story or fired necessary checkpoint?

---

<div class="post-metadata">

**Author:** ![nik202](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nik202/32/16098_2.png) [@nik202](https://forum.rasa.com/u/nik202)\
**Post date:** [August 4, 2021, 5:28pm UTC](https://forum.rasa.com/t/how-to-create-story-base-on-a-catgory-slot-value/46532/2 "2021-08-04T17:28:57Z")

</div>

@Kosechok

Demo use case:

```
 slots:
   account_type:
      type: categorical
      values:
      - premium
      - basic

  stories:
     steps:
       - intent: utter_greet
       - action: action_fetch_profile
          - slot_was_set:
               - status: basic
       - action: utter_welcome_basic

```

May be something like this you must have done for your action:

```
from rasa_core.actions import Action
import requests

class FetchProfileAction(Action):
    def name(self):
        return "fetch_profile"

    def run(self, dispatcher, tracker, domain):
        url = "http://myprofileurl.com"
        data = requests.get(url).json
        return [SlotSet("account_type", data["account_type"])]

```

Try as you asked in two words, so much pressure 😛 that’s what you looking or my bad

---

<div class="post-metadata">

**Author:** ![Kosechok](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/kosechok/32/12803_2.png) [@Kosechok](https://forum.rasa.com/u/Kosechok)\
**Post date:** [August 4, 2021, 7:55pm UTC](https://forum.rasa.com/t/how-to-create-story-base-on-a-catgory-slot-value/46532/3 "2021-08-04T19:55:57Z")

</div>

Thx And do you have any suggestion for situation if this slot was seted earlyer? I can check slot value in a action, but how i can select necessary story?

---

<div class="post-metadata">

**Author:** ![nik202](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nik202/32/16098_2.png) [@nik202](https://forum.rasa.com/u/nik202)\
**Post date:** [August 4, 2021, 10:14pm UTC](https://forum.rasa.com/t/how-to-create-story-base-on-a-catgory-slot-value/46532/4 "2021-08-04T22:14:48Z")

</div>

@Kosechok the above action file as you can see it setting the slot and that slot you using for the next story? Or I get you wrong? ☹

---

<div class="post-metadata">

**Author:** ![Kosechok](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/kosechok/32/12803_2.png) [@Kosechok](https://forum.rasa.com/u/Kosechok)\
**Post date:** [August 5, 2021, 6:27am UTC](https://forum.rasa.com/t/how-to-create-story-base-on-a-catgory-slot-value/46532/5 "2021-08-05T06:27:56Z")

</div>

You are correct, but i’m talking about another case, I already have stored slot (set it in another story) And now I must check if slot stored(if not i will ask user and store id), and if i have a slot i should continue necessary story

---

<div class="post-metadata">

**Author:** ![nik202](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nik202/32/16098_2.png) [@nik202](https://forum.rasa.com/u/nik202)\
**Post date:** [August 5, 2021, 7:42am UTC](https://forum.rasa.com/t/how-to-create-story-base-on-a-catgory-slot-value/46532/6 "2021-08-05T07:42:01Z")

</div>

@Kosechok did you tried the above suggestion? even try use `rasa interactive` and see what’s going on.

---

<div class="post-metadata">

**Author:** ![nik202](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nik202/32/16098_2.png) [@nik202](https://forum.rasa.com/u/nik202)\
**Post date:** [September 7, 2021, 3:28pm UTC](https://forum.rasa.com/t/how-to-create-story-base-on-a-catgory-slot-value/46532/7 "2021-09-07T15:28:57Z")

</div>

@Kosechok Heya! I hope you doing fine, are you able to solve this issue?

---

<div class="post-metadata">

**Author:** ![Kosechok](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/kosechok/32/12803_2.png) [@Kosechok](https://forum.rasa.com/u/Kosechok)\
**Post date:** [September 17, 2021, 12:56pm UTC](https://forum.rasa.com/t/how-to-create-story-base-on-a-catgory-slot-value/46532/8 "2021-09-17T12:56:11Z")

</div>

@nik202 thx i will test it a little later, i’ll be back with a results

---

<div class="post-metadata">

**Author:** ![nik202](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nik202/32/16098_2.png) [@nik202](https://forum.rasa.com/u/nik202)\
**Post date:** [September 17, 2021, 1:59pm UTC](https://forum.rasa.com/t/how-to-create-story-base-on-a-catgory-slot-value/46532/9 "2021-09-17T13:59:12Z")

</div>

@Kosechok No worries. Hope this will solve your issue, if it work please close this thread or shared your own solution for others. Good Luck!
