How to use custom payload responses with buttons?

I am already aware of how to use Rasa buttons as well as using Rasa json payload each on its own.

However, My use case is a little different, I want to set up Rasa buttons to send a custom JSON payload as response when clicked on.

How can I do this?

@OmarFarag95 you need to define a custom action and using that you can send that json payload

Hi @OmarFarag95 ,

In action file,

Declare and define button=[]


dispatcher.utter_message(buttons=button, text=“text_to_display”)

@OmarFarag95 You need to see this link Chatbot-Widget/ at main · JiteshGaikwad/Chatbot-Widget · GitHub or if you are using front end like rasa web chat read this thread Rasa Webchat Carousel Example

If problem still persist, give some generic example what you exactly required.

@OmarFarag95 Hope you solved your issue?