I have a flow setup in Twilio studio. The flow asks for an extension. That information is then passed through a conditional block. If the person presses 1, it goes somewhere specifc, the same if 2 is pressed, and all the rest are transitioned to a script. How do I get the pressed value?
Asked
Active
Viewed 237 times
3 Answers
0
Twilio developer evangelist here.
To get the pressed button value, you can use the Gather Input on Call
widget (more info on that here). Your flow may look something like this then:
Let me know if this helps at all! :D

lizziepika
- 3,231
- 1
- 14
- 23
-
I must not have explained, I do gather the information, but I'm trying to pass it into a function – Jeremy Reel Feb 12 '20 at 21:41
0
What you can do, is add parameters in the function, and pass the parameters through the flow.
0
The first response is correct with the addition of adding the parameters to the Twilio Studio Run Function widget using the syntax in the 2nd response, widgets.gather_1.Digits (assuming your Widget is named gather_1) as the value for your key.
In the Twilio function, you can pull in this value using the event object and the key you used for the widgets.gather_1.Digits value. You can print it out in your Twilio function using
console.log(event.myKeyName);

Alan
- 10,465
- 2
- 8
- 9