0

I know it's possible to use the return value of a Twilio function, such as widgets.MY_FUCTION_WIDGET_NAME.parsed.xxxxx, but what I really need to do is to set a flow variable from within the function. Is it possible to do this, maybe using the TwilioClient or the Runtime client?

  • You can't set flow variables from within a function, but can I ask why accessing the returned data from the `widgets` variables isn't an option for you? – philnash Feb 24 '20 at 07:12

2 Answers2

0

The only way to reference variables in Studio as if right now is by using the Set Variables widget.

This allows you to use the widget to store global variables in the context of the flow.

You can use the return value of your function in this widget to set it as a global variable!

For example;

Say/Play

Say: "Hello {{flow.variables.firstName}}, how can I help you today"

Hope this helps!

  • Thank you, but that doesn't solve my problem. I don't want to use the return the value of the function. Instead I want to set a flow variable from within the function. Maybe it's not possible. – Keith Larson Feb 13 '20 at 21:19
0

Twilio developer evangelist here.

There is not a REST API method for updating the flow variables of an execution that is in process so you cannot set flow variables directly within the Function.

philnash
  • 70,667
  • 10
  • 60
  • 88