# Weird behaviour in Stories

**URL:** <https://forum.rasa.com/t/weird-behaviour-in-stories/2317>\
**Category:** Rasa Open Source\
**Created:** [October 30, 2018, 5:09pm UTC](https://forum.rasa.com/t/weird-behaviour-in-stories/2317 "2018-10-30T17:09:04Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![custodio](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/custodio/32/520_2.png) [@custodio](https://forum.rasa.com/u/custodio)\
**Post date:** [October 30, 2018, 5:09pm UTC](https://forum.rasa.com/t/weird-behaviour-in-stories/2317/1 "2018-10-30T17:09:05Z")

</div>

I have a story that looks like this:

```
# doubt flow - painel options
* has_doubt
    - utter_has_doubt
* enter_data{"doubts_options": "Painel"}
    - utter_painel_options
* enter_data{"painel_options": "Ativação do painel"}
    - utter_painel_activation_options
> check_painel_activation

## doubt flow - activation painel - option A
> check_painel_activation
* enter_data{"button_options": "A"}
    - utter_painel_activation_link
> check_finish_up

## doubt flow - activation painel - option B
> check_painel_activation
* enter_data{"button_options": "B"}
    - utter_painel_activation_how
> check_finish_up

## doubt flow - activation painel - option C
> check_painel_activation
* enter_data{"button_options": "C"}
    - utter_painel_activation_not_able
> check_finish_up

```

Everything works fine until users gets to check\_painel\_activation. In there it looks like Rasa ignores the entity. The button\_options entity is declared at domain file. Also it is working right identifying it in NLU. As you can see:

```
Received user message 'A' with intent '{'name': 'enter_data', 'confidence': 0.9505975842475891}' and entities '[{'start': 0, 'end': 1, 'value': 'A', 'entity': 'button_options', 'confidence': 0.7102413205981658, 'extractor': 'ner_crf'}]'

```

But for some reason it goes to the wrong part of the story.

```
rasa_core.policies.memoization - There is no memorised next action
rasa_core.policies.ensemble - Predicted next action using policy_1_KerasPolicy
rasa_core.processor - Predicted next action 'utter_painel_activation_not_able' with prob 0.31.

```

Why it doesn’t know that it has to go to: ## doubt flow - activation painel - option A ?

I even tried to write a different story instead of using checkpoints I made like this:

```
## doubt flow - painel options with A
* has_doubt
    - utter_has_doubt
* enter_data{"doubts_options": "Painel"}
    - utter_painel_options
* enter_data{"painel_options": "Ativação do painel"}
    - utter_painel_activation_options
* enter_data{"button_options": "A"}
    - utter_painel_activation_link
> check_finish_up

## doubt flow - painel options with B
* has_doubt
    - utter_has_doubt
* enter_data{"doubts_options": "Painel"}
    - utter_painel_options
* enter_data{"painel_options": "Ativação do painel"}
    - utter_painel_activation_options
* enter_data{"button_options": "B"}
    - utter_painel_activation_how
> check_finish_up

## doubt flow - painel options with C
* has_doubt
    - utter_has_doubt
* enter_data{"doubts_options": "Painel"}
    - utter_painel_options
* enter_data{"painel_options": "Ativação do painel"}
    - utter_painel_activation_options
* enter_data{"button_options": "C"}
    - utter_painel_activation_not_able
> check_finish_up

```

And I get the same problem. Although it recognizes the button\_options entity it goes to the wrong part of the story. When the value is A it goes to B for example.

Regards, Leonardo

---

<div class="post-metadata">

**Author:** ![custodio](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/custodio/32/520_2.png) [@custodio](https://forum.rasa.com/u/custodio)\
**Post date:** [October 30, 2018, 5:46pm UTC](https://forum.rasa.com/t/weird-behaviour-in-stories/2317/2 "2018-10-30T17:46:43Z")

</div>

Ah I think I got it. That’s because you cannot make a conditional through stories? You can just put a sample of the entity there but you cannot really say that needs to be that one? So we need to use an action to perform the conditional?

---

<div class="post-metadata">

**Author:** ![souvikg10](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/souvikg10/32/93_2.png) [@souvikg10](https://forum.rasa.com/u/souvikg10)\
**Post date:** [October 30, 2018, 8:15pm UTC](https://forum.rasa.com/t/weird-behaviour-in-stories/2317/3 "2018-10-30T20:15:54Z")

</div>

is the slot button\_options categorical?

---

<div class="post-metadata">

**Author:** ![custodio](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/custodio/32/520_2.png) [@custodio](https://forum.rasa.com/u/custodio)\
**Post date:** [October 30, 2018, 8:29pm UTC](https://forum.rasa.com/t/weird-behaviour-in-stories/2317/4 "2018-10-30T20:29:10Z")

</div>

button\_options is not a slot it is an intent.

---

<div class="post-metadata">

**Author:** ![souvikg10](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/souvikg10/32/93_2.png) [@souvikg10](https://forum.rasa.com/u/souvikg10)\
**Post date:** [October 30, 2018, 8:29pm UTC](https://forum.rasa.com/t/weird-behaviour-in-stories/2317/5 "2018-10-30T20:29:49Z")

</div>

> [@custodio](#):
>
> - enter\_data{“button\_options”: “C”}

it seems like a slot

---

<div class="post-metadata">

**Author:** ![custodio](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/custodio/32/520_2.png) [@custodio](https://forum.rasa.com/u/custodio)\
**Post date:** [October 30, 2018, 9:04pm UTC](https://forum.rasa.com/t/weird-behaviour-in-stories/2317/6 "2018-10-30T21:04:00Z")

</div>

I meant entity not intent, sorry. Entities are written the same way as slots in the story isn’t? Is there a different way to write it?

Ps.: the entity is defined in the NLU and is also allowed in the domain

---

<div class="post-metadata">

**Author:** ![custodio](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/custodio/32/520_2.png) [@custodio](https://forum.rasa.com/u/custodio)\
**Post date:** [October 30, 2018, 9:10pm UTC](https://forum.rasa.com/t/weird-behaviour-in-stories/2317/7 "2018-10-30T21:10:01Z")

</div>

I solved the issue by making an Action but it would be much easier to do it in stories if that’s possible.

Is it possible to make stories conditional to entities? Or that’s possible only with intents?

---

<div class="post-metadata">

**Author:** ![souvikg10](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/souvikg10/32/93_2.png) [@souvikg10](https://forum.rasa.com/u/souvikg10)\
**Post date:** [October 30, 2018, 9:53pm UTC](https://forum.rasa.com/t/weird-behaviour-in-stories/2317/8 "2018-10-30T21:53:20Z")

</div>

You can make it conditional if you add them as slots and slots which are of type categorical

Button\_options should be stored as slots after extracted as an entity. If it is extracted from NLU then simply name the slot button\_options

Make sure the type is categorical Check rasa documentation
