Store an array in variable, pass it and display in delivery
Hi,
I have a workflow that is built from Query activity, Advanced Javascript and delivery. For each recipient from the query I am doing calculations in Advanced JS activity and it returns an array. Its length may be different - from 1 element to 5.
So for example, in JS activity after I'm done with all business logic I save the array (myArray) to instance.vars:
var myArray = [1, 50, 100];
instance.vars.arrayForDelivery = myArray;
Let's assume that I want to have each element in a separate paragraph:
<% for (var i=0; i < (arrayForDelivery.length - 1); i++) { %>
<p>instance.vars.arrayForDelivery[i]</p>
<%}%>
What should be done next, in the delivery, to loop through all arrayForDelivery elements? The code above is just example because it seems to not be working.
Best,
Dominik