Issue with Input


#1

I keep getting the error, “Message: Cannot read property ‘value’ of undefined.” This is the line that is causing the error:

        let iterCommand = this.$inputs.iterationCommand.value;

The above code is in “SearchResultIterationIntent” in app.js.

Here is the language model:

{
“name”: “SearchResultIterationIntent”,
“phrases”: [
“{iterationCommand}”,
“move {iterationCommand”,
“move to {iterationCommand}”
],
“inputs”: [
{
“name”: “iterationCommand”,
“type”: “IterationCommand”
}
],
“dialogflow”: {
“webhookUsed”: true
}
}

Here is the InputType IterationCommand:

{
“name”: “IterationCommand”,
“dialogflow”: {
“automatedExpansion”: true
},
“values”: [
{
“value”: “next”
},
{
“value”: “repeat”
},
{
“value”: “previous”
}
]
},

I have no idea what is going on? There are no compilation errors or JSON errors. Everything, as far as I can tell, is fine. I use other input values in the same state and they work fine. Any help would be greatly appreciated!


#2

Could you log this.$inputs and paste it here?


#3

[object Object] is what printed


#4

You need to stringify it:

console.log(JSON.stringify(this.$inputs));


#5

“{}” is what printed after I stringified

It routes to the correct intent when I give input that is type IterationCommand it just does not save the input.


#6

Can you paste the full request JSON?