How to use synonyms and main value of the slot?


#1

Hello,
I need to create a custom slot type that allows me to receive on purpose any of the synonyms but then use the value for that slot. However, when I use the code <this.$inputs.device.value> it returns the synonym said by the user but not the main value of the slot.

For example if the user says “video beam” which is a synonym, I want to use “PROJECTOR”.
Is it possible?
How can I relate the synonym to the main value of the slot?

the custom slot code is the following:

"name":"Device",
"values":[
	{
		"value":"AC",
		"synonyms":[
			"air conditioner",
			"CA",
			"air conditioning",
			"air",
			"central air",
			"climatization",
			"air cooling",
			"cooling air",
			"AC"
		]
	},
	{
		"value":"PROJECTOR",
		"synonyms":[
			"video beam",
			"conference",
			"epidiascope",
			"flim projector",
			"movie projector",
			"cine projector",
			"cinema",
			"slide projector",
			"front projector",
			"projector",
			"overhead projector"
		]
	}

#2

You can use this.$inputs.device.key for this.


#3

Do you use the Jovo Debugger? Synonyms don’t work there yet.

See https://github.com/jovotech/jovo-framework/issues/560


#4

Yes, i’m using jovo debugger. I will try directly on an amazon echo dot and performing the deployment on lambda. to test the solution of @jan