How to resolve synonyms

amazon-alexa

#1

My skill uses synonyms for a few categories that the user can choose. On Google, these work fine but on Alexa it doesn’t return the canonical slot value in this.$inputs.category.value. E.g. user says start up but it should be mapped to startup.

In my logs I see this:
Screenshot_1

How can I access this resolutions value in a way that would work for both Alexa and Google?


Alexa - Using inputMap with synonyms
Problem with synonyms
#2

Instead of this.$inputs.inputName.value, try this:

this.$inputs.inputName.key

// Your example
this.$inputs.category.key

You could also access the ID with this.$inputs.inputName.id


#3

Thank you - that worked! What might I want to use the id for?


#4

Great!

The ID only works for Alexa as far as I know, not for Dialogflow. Some people use it for easier matching with database entries, for example.