# Using slot value from custom channel

**URL:** <https://forum.rasa.com/t/using-slot-value-from-custom-channel/52084>\
**Category:** Rasa Open Source\
**Created:** [March 20, 2022, 10:11am UTC](https://forum.rasa.com/t/using-slot-value-from-custom-channel/52084 "2022-03-20T10:11:51Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ahmed3bbas](https://avatars.discourse-cdn.com/v4/letter/a/e480ec/32.png) [@ahmed3bbas](https://forum.rasa.com/u/ahmed3bbas)\
**Post date:** [March 20, 2022, 10:11am UTC](https://forum.rasa.com/t/using-slot-value-from-custom-channel/52084/1 "2022-03-20T10:11:52Z")

</div>

Hello, I am new to rasa (using Botfront) and I have troubles using the value of a slot in Botfront custom channel from more clarification  
in Botfront rest API request looks like this:

```auto
{
    "sender": "test_user",
    "message": "test",
    "customData": {
        "language": "en"    
    }
}

```

so I need the “language” key to be set from a slot so I made custom channel based on Botfront rest API and implement the get\_metadata function to get last value for the slot for the user

need something like that:

```auto
class MyRestInput(BotfrontRestInput):
    def get_metadata(self, request: Request) -> Optional[Dict[Text, Any]]:
        language = tracker.get_slot("language","en")

        return {'language': language}

```

---

<div class="post-metadata">

**Author:** ![stephens](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/stephens/32/1632_2.png) [@stephens](https://forum.rasa.com/u/stephens)\
**Post date:** [March 21, 2022, 4:47pm UTC](https://forum.rasa.com/t/using-slot-value-from-custom-channel/52084/2 "2022-03-21T16:47:16Z")

</div>

The botfront [rasa-webchat](https://github.com/botfront/rasa-webchat) uses sockets not REST. Why are are you using a custom REST channel instead of socket channel?

> I need the “language” key to be set from a slot

`customData.language` is sent from the chat widget to Rasa. `customData.language` is not a slot, it is an object provide on the socket channel so you can’t call `tracker.get_slot` for this value.

---

<div class="post-metadata">

**Author:** ![ahmed3bbas](https://avatars.discourse-cdn.com/v4/letter/a/e480ec/32.png) [@ahmed3bbas](https://forum.rasa.com/u/ahmed3bbas)\
**Post date:** [March 22, 2022, 10:34am UTC](https://forum.rasa.com/t/using-slot-value-from-custom-channel/52084/3 "2022-03-22T10:34:42Z")

</div>

Hello @stephensI’m using rasa rest API as web hock in the begging of the story I’m asking the user for the preferred language then save the selected language in a slot now when ever I have this sender id in the rest API I want to check the user history and get the last value of the language Slot to reply with it

is it doable?

thanks

---

<div class="post-metadata">

**Author:** ![stephens](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/stephens/32/1632_2.png) [@stephens](https://forum.rasa.com/u/stephens)\
**Post date:** [March 22, 2022, 3:52pm UTC](https://forum.rasa.com/t/using-slot-value-from-custom-channel/52084/4 "2022-03-22T15:52:13Z")

</div>

If you’re using the botfront rasa-webchat widget, then your using the socket channel. Can’t use both.

---

<div class="post-metadata">

**Author:** ![ahmed3bbas](https://avatars.discourse-cdn.com/v4/letter/a/e480ec/32.png) [@ahmed3bbas](https://forum.rasa.com/u/ahmed3bbas)\
**Post date:** [March 23, 2022, 11:37am UTC](https://forum.rasa.com/t/using-slot-value-from-custom-channel/52084/5 "2022-03-23T11:37:50Z")

</div>

I’m not using botfront rasa-webchat I’m using

> **[GitHub - botfront/rasa-for-botfront: A fork to be used with Botfront, another...](https://github.com/botfront/rasa-for-botfront)**
>
> A fork to be used with Botfront, another UI for Rasa. - GitHub - botfront/rasa-for-botfront: A fork to be used with Botfront, another UI for Rasa.

---

<div class="post-metadata">

**Author:** ![stephens](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/stephens/32/1632_2.png) [@stephens](https://forum.rasa.com/u/stephens)\
**Post date:** [March 23, 2022, 11:17pm UTC](https://forum.rasa.com/t/using-slot-value-from-custom-channel/52084/6 "2022-03-23T23:17:11Z")

</div>

Can’t help you with botfront. The project was archived a year ago.

---

<div class="post-metadata">

**Author:** ![ahmed3bbas](https://avatars.discourse-cdn.com/v4/letter/a/e480ec/32.png) [@ahmed3bbas](https://forum.rasa.com/u/ahmed3bbas)\
**Post date:** [March 24, 2022, 10:15am UTC](https://forum.rasa.com/t/using-slot-value-from-custom-channel/52084/7 "2022-03-24T10:15:13Z")

</div>

ok Thanks
