ON_ELEMENT_SELECTED() doesn't get triggered

google-assistant
dialogflow

#1

Hi, I’m new to Jovo and I’m trying to learn it. I followed the tutorial to create the hello world project using DialogFlow, Lambda AWS + API gateway. Now i wanted to add some button and get the user answer. I have found that there is the method: ON_ELEMENT_SELECTED() that should get triggered when the user click something in a List or Carousel. Here’s the problem: when i test my code with the Action Console Test, and i click on some item in the list, it gets triggered the Default Callback Intent of DialogFlow, instead of ON_ELEMENT_SELECTED().
The error i get is:

Code:
ERR_NO_MATCHING_PLATFORM

Message:
Can’t handle request object.

Stack:
Error: Can’t handle request object.
at App.handle (/var/task/node_modules/jovo-core/dist/src/core/BaseApp.js:176:23)
at async App.handle (/var/task/node_modules/jovo-framework/dist/src/App.js:265:9)
at async Runtime.exports.handler (/var/task/index.js:26:3)

Module:
jovo-core

Hint:
Please add an integration that handles that type of request.



WARN: Jovo instance is not available. ON_ERROR doesn’t work here
2020-12-17T12:31:24.491Z 8baea6c6-3549-4e0c-905a-b2739c6e9fb0 ERROR Invoke Error {“errorType”:“Error”,“errorMessage”:“Can’t handle request object.”,“code”:“ERR_NO_MATCHING_PLATFORM”,“module”:“jovo-core”,“hint”:“Please add an integration that handles that type of request.”,“stack”:[“Error: Can’t handle request object.”," at App.handle (/var/task/node_modules/jovo-core/dist/src/core/BaseApp.js:176:23)"," at async App.handle (/var/task/node_modules/jovo-framework/dist/src/App.js:265:9)"," at async Runtime.exports.handler (/var/task/index.js:26:3)"]}

This is my initialization:
const { App } = require(‘jovo-framework’);
const { Alexa } = require(‘jovo-platform-alexa’);
const { GoogleAssistant, OptionItem, List, Carousel } = require(‘jovo-platform-googleassistant’);
const { JovoDebugger } = require(‘jovo-plugin-debugger’);
const { FileDb } = require(‘jovo-db-filedb’);

// ------------------------------------------------------------------
// APP INITIALIZATION
// ------------------------------------------------------------------

const app = new App();

app.use(
new Alexa(),
new GoogleAssistant(),
new JovoDebugger(),
new FileDb()
);


#2

I think i have solved the problem myself, it was really a trivial error. I needed to create an intent in DialogFlow that could be triggered by the event actions_intent_OPTION (doc: https://developers.google.com/assistant/conversational/df-asdk/selection-responses#list), like this: s1
Then ON_ELEMENT_SELECTED() works fine, but i noticed 2 things:

  • In the code i can’t use pressButton() instead of ON_ELEMENT_SELECTED() to refer to the intent that gets triggered after the click.

  • In the Lambda tester it still gives me the same error as before, but with the Google Action Simulator it works fine.