optimistic-goldā¢2y ago
Custom Actions Youtube Tutorial question
Hello Voiceflow team,
I'm reposting my question from the #š¬āgeneral-chat channel here:
This is regarding custom actions.
Hi I'm following the custom action youtube tutorial for rendering custom actions and I noticed that last_event is returning null after I make a carousel selection. Is last_event still being populated after custom action step executes?
Video source: https://www.youtube.com/watch?v=2V46rOkkprg&t=130s
This is the javascript code I used from the tutorial:
2 Replies
The
last_event
system variable is designed to capture the trace of the last user event such as a button selection, carousel button selection, and when an intent is triggered. The type of this is { type: string, payload: object | string }
.
In the context of a Custom Action, the last_event
should indeed be populated after the execution of the Custom Action step, capturing the user's interaction with the Carousel. If it's returning null, it might be due to the absence of a user event after the Custom Action step.
However, it's important to note that the last_event
variable will only capture events that are interacted with when the Global Listen setting is enabled. By default, Voiceflow listen steps actively listen for user events only until the event is detected. When Global Listen is enabled, any of the Custom Actionās elements that can be interacted with will continue to listen for a user event such as a button click.
If you've ensured that the Global Listen setting is enabled and you're still experiencing this issue, it might be a good idea to revisit the code and ensure that the last_event
variable is being called correctly.
Source: Voiceflow Developer Documentationoptimistic-goldOPā¢2y ago
I've tried to set the Global Listen setting as enabled and I still get a null
last_event
back.