Iterator dumping all values together

:bullseye: What is your goal?

Get creative id and assets from facebook

:thinking: What is the problem & what have you tried?

As shown in screenshot
HttpModule1: Pulls all ad ids from facebook ads account

iterator: stripsout data other than ad ids from results of httpmodule 1 and ideally should iterate ids one at a time to Httpmodule2

HttpModule2: Queries each ad id to facebook api for creative id and assets

:clipboard: Error messages or input/output bundles

But the iterator is sending all add ids to httpmodule at once rather than one at a time.
Attached screenshot and blueprint

:camera_with_flash: Screenshots (scenario flow, module settings, errors)

Integration Facebook Insights, Google Sheets.blueprint.json (25.2 KB)

1 Like

Hi Nikhil,

The issue isn’t really the iterator itself, it’s the way the array is being built before it reaches it.

In your blueprint, you’re using map(5.data.data; “ad_id”), which already produces a full array of ad IDs. Then you’re wrapping that again as a single array input for the iterator. As a result, the iterator receives one bundle containing all IDs instead of one ID per bundle.

What you want is for the iterator to receive a flat array of ad IDs. Once it does, it will correctly output one bundle per ad ID and your second HTTP module will run once per ID.

After fixing that, using {{value}} in the second HTTP module URL is correct.

Hope this helps.

Regards, Tony

1 Like

While I understand the issue. Not really able to solve it,

1 Like

Hi, Can you paste here output of the module http1 ? And a screenshot of the bundle output. Maybe you’d need to use split() function in the iterator to split IDs ? I can’t see the structure.

1 Like