Here’s how I like to experiment with structures. I use Parse JSON module to model the output bundles I expect to get. So I modeled it with this JSON:
{
"Array": [
{
"id": "866a7nubx",
"name": "Testy McTest",
"custom_fields": [
{
"Email": "testy@mctest.com",
"lastappointment": 1234,
"touchpoint": [{
"a": "abc",
"b": "bcd",
"c": 123} ]
}
]
},
{
"id": "860qtdae",
"name": "Testy2 McTest2",
"custom_fields": [
{
"Email": "testy2@mctest.com",
"lastappointment": 1234,
"touchpoint": [{
"a": "abc",
"b": "bcd",
"c": 123} ]
}
]
}
]
}
The output of Parse JSON is exactly what you’d get out of your regular module:
Here’s how to iterate on the custom_fields array:
And since the array had 2 elements in it, the iterator generates 2 bundles:
Now you can place a set variable and each run through the iterator you will be able to grab the email address from each bundle. This syntax allows you to grab the output from the iterator
Notice there are 2 operations on set variable since the array had 2 elements
Now if you want to combine the output of the bundles from set variable into 1 array with each email in it then you need to array aggregator with the source module being the iterator and click the email from set variable in your aggregator
the result will have 1 array with both emails in it
You can of course place a filter between the Set Variable and the Array Aggregator and only grab the values you want (by using a filter on email address). This will only aggregate into an array any variables set that meet your filter criteria.
Any modules after array aggregator will only execute once since the array aggregator created just 1 bundle (with the array). All aggregators combine multiple bundles into 1 array, by the way.