Building an Action handler

Revisiting the earlier post on non-blocking options. One of the issues that comes up is that it can be messy to have multiple actions for a single function. The other issue is that user inputs can accidentally trigger such survey events. So you want to prevent that.

So the first part is simple. You just move them into one single action. You can even have the sub-action be the handler for the responses.

Within the json the label is what is shown to the end user. The text piece is what gets sent silently to Assistant. Swapping out the thumbs for UUIDs allows you to create training data that can never be triggered by the end user. To make it easier I put a word tag on the end so I remember which is which like so:

Now in the training data of your sub-action you add the UUIDs you created.

Lastly you want to have the steps to look for these in your first steps. Those steps should have a condition statement using the expression editor like so:

Once captured, ensure you finish on that step. Lastly you want to switch off “Ask clarifying question” and “Change conversation topic”.

You now have a poor mans callback. 🙂 I’ve attached the sample skill for you to review.

Leave a Reply