Ford
Ford2mo ago

Extract intent trigger from previous capture

How do I extract the intent from a previous capture? My flow: - Do a capture for user input speech - Do some logic - Now I want to branch based on on the intent that was in the user input I thought I could do it with a Condition, and use the user_input variable and compare to my defined intents, but that doesn't seem to work...
7 Replies
Francois🇫🇷
You could save each user input to an other variable before they send an other message, and then you simply reference this variable to define your intent
W. Williams (SFT)
You can get it from last_event.payload.itent
Ford
FordOP2mo ago
thanks.... if I saved it to "user_input" (or whatever), then in my Condition block I do something like "if user_input = " but how do I check if it's a particular intent? So I have an intent called "Help"... how could I check that user_input = the intent "Help" ?
W. Williams (SFT)
It is the value of the var I put above. You can use a JS or Condition step to check the value of last_event.payload.itent.
Ford
FordOP2mo ago
ok i'll try it, thanks! When I look at the value of last_event.payload.intent, it always says "None". "last_event": { "type": "intent", "payload": { "query": "goodbye", "intent": { "name": "None" }, (If I do a Choice block instead of Capture, the intents work.. ..but not with Capture)
W. Williams (SFT)
can you post a screenshot of your flow?
Ford
FordOP2mo ago
I decided to go with a different approach.. I do a normal Choice block for a few intents, then anything that doesn't match goes to the logic check

Did you find this page helpful?