# Usage of slots in stories

**URL:** <https://forum.rasa.com/t/usage-of-slots-in-stories/2309>\
**Category:** Rasa Open Source\
**Created:** [October 30, 2018, 12:19pm UTC](https://forum.rasa.com/t/usage-of-slots-in-stories/2309 "2018-10-30T12:19:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![thisrav](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/thisrav/32/864_2.png) [@thisrav](https://forum.rasa.com/u/thisrav)\
**Post date:** [October 30, 2018, 12:19pm UTC](https://forum.rasa.com/t/usage-of-slots-in-stories/2309/1 "2018-10-30T12:19:00Z")

</div>

Hi, I am a bit confused what using slots mean in stories. For example consider the following story

> ##story\_test
> 
> - intent\_setName
> 
> - action\_setName
> - slot {“name”:“John”}
> - action\_heyJohn

So, does the third statement mean

1. Like a case statement, checking the value of the slot OR
2. Denotes the occurrence of a SlotSet event ?

If the 1st case is right, that means I can write my stories by using that statement as a condition, correct? If the 2nd case is right, then would that mean that if I wanted to split my story based on the slot “name” long after the slot set event, this would not work? For example:

> ##story\_test
> 
> - intent\_setName
> 
> - action\_setName
> - doRandomStuff1
> 
> - sayRandomStuff
> 
> - doRandomStuff
> - slot {“name”:“John”}
> - action\_heyJohn

---

<div class="post-metadata">

**Author:** ![akelad](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/akelad/32/69_2.png) [@akelad](https://forum.rasa.com/u/akelad)\
**Post date:** [November 2, 2018, 3:00pm UTC](https://forum.rasa.com/t/usage-of-slots-in-stories/2309/2 "2018-11-02T15:00:52Z")

</div>

It’s both of them really. So it marks that the action set a slot, and also you can use it to determine the path of the conversation. So yeah if your action failed to set the slot you can have a different story. Or if you have a categorical slot, then you can have a different story path dependent on the exact value of the conversation.

---

<div class="post-metadata">

**Author:** ![yuimo](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/yuimo/32/7125_2.png) [@yuimo](https://forum.rasa.com/u/yuimo)\
**Post date:** [February 19, 2020, 9:19am UTC](https://forum.rasa.com/t/usage-of-slots-in-stories/2309/3 "2020-02-19T09:19:52Z")

</div>

hi akelad, i have another question. is this statement below is necessary?

‘slot {“name”:“John”}’

and there maybe several slots in a action, should i list them all after the call of action?

and could i write the story like this:

```
intent_setName
action_setName
action_depent_slot_value_of_name

```

that is i’ll get value of slot ‘name’, and do something in another action according the value, could i? thanks a lot.
