question

shubham salokhe avatar image
shubham salokhe asked

Is it possible or any way to trigger an intent with custom slot without setting values for that slot?

I want to trigger Question intent in which always different 4-5 questions will be asked to user, Everytime respond of users is different(dynamic) so cant set values for that slot. So how can I trigger same intent after first question asked to user and after user response alexa will ask next question and so on....Want to trigger question intent for ask second question without setting values for custom slot there is any way for it....

alexa skills kitask sdk
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Andy Whitworth avatar image
Andy Whitworth answered

If you know the answer(s) for each question at the time you ask the question then you can do this.

You need to look at Dynamic Entities, this allows you to define the list of slot values dynamically. I use Dynamic Entities for quiz skills where the list of slot utterances needs to change for each question.

Here's the Amazon documentation:

https://www.developer.amazon.com/es-MX/docs/alexa/custom-skills/use-dynamic-entities-for-customized-interactions.html

Dynamic Entities are pretty easy to work with, you just return a directive each time you want to change the slot values (you'd fo this when asking each question). You may need to change your slot handling code, as slot values associated with dynamic entities contain "amzn1.er-authority.echo-sdk.dynamic" in the authority string (check out the example code here https://github.com/alexa/alexa-cookbook/tree/master/feature-demos/dynamic-entities/skill-demo-dynamic-entities/lambda/custom )

When you exit the skill it's best practive to clear the dynamic entities by returning a directive too.

15 comments
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

shubham salokhe avatar image shubham salokhe commented ·
Thank you i will check this and if there will be any problem I will revert here...
0 Likes 0 ·
shubham salokhe avatar image shubham salokhe commented ·

There is any python code to understand how Dynamic Entities work?


0 Likes 0 ·
shubham salokhe avatar image shubham salokhe Andy Whitworth commented ·

Thank you I understand this but suppose if user responded any other values which are not mentioned in synonyms then it will trigger same intent as we expected or not?

0 Likes 0 ·
Show more comments