# Utter\_custom\_json() seem not working and quick replies in custom actions

**URL:** <https://forum.rasa.com/t/utter-custom-json-seem-not-working-and-quick-replies-in-custom-actions/57638>\
**Category:** Rasa Open Source\
**Created:** [March 18, 2023, 3:20pm UTC](https://forum.rasa.com/t/utter-custom-json-seem-not-working-and-quick-replies-in-custom-actions/57638 "2023-03-18T15:20:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jcuxdc123](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/jcuxdc123/32/22890_2.png) [@jcuxdc123](https://forum.rasa.com/u/jcuxdc123)\
**Post date:** [March 18, 2023, 3:20pm UTC](https://forum.rasa.com/t/utter-custom-json-seem-not-working-and-quick-replies-in-custom-actions/57638/1 "2023-03-18T15:20:11Z")

</div>

I am having a custom action like this:

```auto
class MyAction(Action):
    def name(self) -> Text:
        return "my_action"

    def run(
        self,
        dispatcher: CollectingDispatcher,
        tracker: Tracker,
        domain: Dict[Text, Any],
    ) -> List[Dict[Text, Any]]:

        message = {
            "text": "Hello",
            "quick_replies": [
                {
                    "content_type": "text",
                    "title": "Hi",
                    "payload": "/affirm",
                },
                {
                    "content_type": "text",
                    "title": "Goodbye",
                    "payload": "/deny",
                },
            ],
        }
        dispatcher.utter_custom_json(message)
        return []

```

I ran the chatbot on a html webpage. When the action is run, the widget suddenly disappear and this message come out from browser:

```auto
Uncaught TypeError: Cannot read properties of undefined (reading 'image')
    at rh (rasa-chat:2:763681)
    at rasa-chat:2:765020
    at aa (rasa-chat:2:79647)
    at sa (rasa-chat:2:80101)
    at Object.useState (rasa-chat:2:85997)
    at t.useState (rasa-chat:2:336049)
    at ah (rasa-chat:2:764396)
    at ra (rasa-chat:2:78873)
    at Ba (rasa-chat:2:88391)
    at Vs (rasa-chat:2:132052)

```

I also tried with `dispatcher.utter_message(json_message=message)` but it didnot work either. So, is there something wrong with it and how to fix?

By the way, is that the right way to define quick replies in custom action, and will the quick\_replies defined in custom actions appear in webpage widget?

I am using Rasa 2.x

Thanks a lot!!
