# Set slot and entity with Rasa buttons

**URL:** <https://forum.rasa.com/t/set-slot-and-entity-with-rasa-buttons/47586>\
**Category:** Rasa Open Source\
**Created:** [September 8, 2021, 3:22pm UTC](https://forum.rasa.com/t/set-slot-and-entity-with-rasa-buttons/47586 "2021-09-08T15:22:41Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![ChrisRahme](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/chrisrahme/32/15572_2.png) [@ChrisRahme](https://forum.rasa.com/u/ChrisRahme)\
**Post date:** [September 8, 2021, 3:47pm UTC](https://forum.rasa.com/t/set-slot-and-entity-with-rasa-buttons/47586/2 "2021-09-08T15:47:26Z")

</div>

Hello!

> [@Chatbot\_Ra](#):
>
> If I understand it correctly, the logic works as following:
> 
> ```auto
> '/intent_name{{"entity_type_1":"entity_value_1"}}'
> 
> ```

That’s correct. Though you use single brackets inside Custom Actions.

* * *

> [@Chatbot\_Ra](#):
>
> Do I need this: `'` ?

You don’t necessarily need to use quotes around the payload.

Look at [this](https://github.com/RasaHQ/financial-demo/blob/main/domain.yml#L150) example.

* * *

> [@Chatbot\_Ra](#):
>
> Do I have to define the entities `motor` and `home` in the nlu.yml file? I don’t see why, because the entity should automatically be set by the button. In other words: the entity is hardcoded. There is no NLU involved (according to my understanding).

You’re correct. With the payload, you are forcing the bot to take this value as an entity.

I would still recommend adding the values in your examples though, just in case the user decides to types instead of clicking a button - unless you want to disable the text input when there are buttons.

* * *

> [@Chatbot\_Ra](#):
>
> Is there a way to directly set a slot with a button? Something like this for example:
> 
> ```auto
> '/intent_name{{"slot_name":"slot_value"}}'
> 
> ```

The current way to set a slot via a payload is by setting its entity and having [auto-fill](https://rasa.com/docs/rasa/domain/#slot-auto-fill).

---

_[View the full topic](https://forum.rasa.com/t/set-slot-and-entity-with-rasa-buttons/47586)._
