I have a callflow which returns a nested array, which I then need to iterate through based on responses by the called party. The results of this are parsed and returned. The count of the arrays is also returned and I've assigned a variable to this e.g. 'flow.variables.arraynameCount'
I am attempting to loop through a portion of the callflow, and iterate through the array elements. However, using a technique such as arrayname.[{{flow.variables.arraynameCount}}].foo isn't working. Twilio is interpreting this as literally as string, and not the underlying value.
What am I doing wrong? Is it not possible to reference a flow variable in this context?
You can use Liquid for simple looping through JSON arrays:
{% for item in widgets.<widget_name>.parsed.result %}
{{ item.<json-key> }}. {% comment %} item variable will have array element in each iteration {% endcomment %}
{% endfor %}
(example taken from here)
For more complex actions, such as making a call per array element, it might make sense to use Twilio Functions.