Vikas Patidar
Vikas Patidar

Reputation: 213

MalformedResponse : Failed to parse Dialogflow response into AppResponse: Index: 0

I have added few items in the list response so that user can select an item from the list

scenario

bot: hello what you want to update (list will open with options as{title, objective, place})
user: title {selects either by clicking or typing}
bot: Enter your title (webhook response)
user: xyz
bot: record updated
but the issue is when user clicks on any item it gives me an error

"Sorry, Test Apps isn't responding right now. Please try again soon."

and the reason for this error is

MalformedResponse Failed to parse Dialogflow response into AppResponse: Index: 0.

this is my code

app.intent(CREATE_INTENT, (conv) => {
conv.ask("Here's the list");
  conv.ask(new List({
    title: "Select an option to update",
    items: {     
      'SELECTION_KEY_TITLE': {
        synonyms: [
          'Title',
          'title',
        ],
        title: 'title',
        description: 'Click here to update title',
        image: new Image({
          url: 'https://storage.googleapis.com/actionsresources/logo_assistant_2x_64dp.png',          alt: 'Image alternate text',
        }),
      },

      'SELECTION_KEY_PLACE': {
        synonyms: [
          'place',
          'Place',
      ],
        title: 'place',
        description: 'This is for updating your city name',
        image: new Image({
          url: 'https://storage.googleapis.com/actionsresources/logo_assistant_2x_64dp.png',          alt: 'Google Home',
        }),
      },

      'SELECTION_KEY_OBJECTIVE': {
        synonyms: [
          'objective',
          'Objective',
        ],
        title: 'objective',
        description: 'select to update objective',
        image: new Image({
          url: 'https://storage.googleapis.com/actionsresources/logo_assistant_2x_64dp.png',          alt: 'Google Pixel',
        }),
      },
    },
  }));

app.intent(TITLE_INTENT, (conv, option) => {  
       if (option === SELECTION_KEY_TITLE) {
     conv.ask("Please enter your resume title");
     } else if (option === SELECTION_KEY_PLACE) {
     conv.ask("What's your current city?");
     } else if (option === SELECTION_KEY_OBJECTIVE) {
     conv.ask("Please enter your objective");
     } else {
         conv.ask('Sorry! please select one option to update.');
         conv.ask(new Suggestions(['Title', 'Place', 'Objective']));
     }
});

Upvotes: 0

Views: 173

Answers (2)

Vikas Patidar
Vikas Patidar

Reputation: 213

I figured out this issue we have to remove all the training phrases from the TITLE_INTENT and make sure in the event section you have to add actions_intent_OPTION

Upvotes: 0

Prisoner
Prisoner

Reputation: 50701

Your screenshots indicate you have a list that you're interacting with by touching it - but you said you don't have any webhooks. Handling a list interaction can only be processed via webhook.

You don't show all of the Intents, but it seems likely that the Fallback Intent is called (as you mention in the comments) because you don't have an Intent that handles the action_intent_OPTION Event.

It sounds like you probably want to use suggestion chips rather than a List. Suggestion Chips are good for helping guide the user about how they can continue the conversation, while Lists are good for presenting results and having the user select one of these results. Suggestion chips are also treated exactly as if the user had said or typed them and do not require special handling to process.

Upvotes: 1

Related Questions