I am working with two widgets for the purposes of this question:
The Set variables widget, and the split based on the widget. I want to iterate over my array which I am passing in (flow.data.arr
):
I am trying in set variables:
key: increment
value: {% if flow.variables.increment %}{{flow.variables.increment | plus:1}}{% else %}0{% endif %}
and in the split based on:
condition: flow.data.arr[increment].nestedValue isNotBlank
I have tested with numbers and if I insert a 0 or 1 then it works perfectly. My assumption is that it is evaluating the increment
var as a string, as when I had included spaces inside of the if logic, it added those spaces inside of the string.
SO If my assumption is correct, how can I make Twilio evaluate increment
as a number? If my assumption is wrong how can I achieve this "for loop" style iteration?