How to collect data from button to slot?

I want to collect data from button to slot . can you please help me?

1 Like

@darpant-289 Can you explain more with a example?

hi @nik202 , Lets suppose we have a question like “Do you visited the Doctor” i want to answer with buttons “Yes” or “No”. If yes selected through button i want to extract this value so that i can send it to an api .

@nitish007 OK

Bot: Do you visit the doctor? Yes | No

User: Yes

on Yes you have to set the payload, update the story with action and the payload will trigger the custom action for API.

Hope it will help!

1 Like

okay

that’s fine @nik202 , I tried but not able to fetch the value of slot . If you can help with something handy .

let me know if i can share the code snippet with you.

Not today Now at RASA Conference L3, may be later!

1 Like

@nik202 Can you please share a code snippet or shall i share mine ? I am stuck here .

@darpant-289 guys, can you please help me here with button issue

but I am also facing this issue.

@nik can you please help us here

@darpant-289 share all the files and let me check the issue for you guys. Even if you can share the screenshot it will be great and what currently you have done mention that in brief. I will try my level best to solve this issue.

@nitish007 yes!

@darpant-289 change the code, before mention the buttons you need to mention the text, and also check the title and payload how I mention. Try and tell me. ok good luck.

> utter_menu:
   text: 
>  buttons:
>   - title:
>     payload:

@nik202 I want to fetch the value of button once it is clicked and pass it to an api . tracker.get_slot(“claimtype”) is returning None for me

@nitish007 n story check this Training Data Format how in doc entities are mention.

@nitish007 can you share the original files? its not clear for me sorry. action.py?

@nik202 please find the action.py

is this how slot and entity should be in stories

@nitish007 share me all the original file’s (all); not the screenshots please. I will run the code later in the day for you. Mean while execute the code step by step.