Iterator processes correctly but I can't map the results after

I am building a scenario that copies data from Etsy listings to new Etsy listings. Here’s an overview of my scenario so far:

As part of this process, I need to iterate over an array called products, which contains a variable number of nested product subofferings. Within each of these subofferings, I’ll ultimately need to pull some data into a JSON format to send over to Etsy.

This brings me to my problem. I have set up an iterator to iterate over the products array, and it seems to be processing correctly:

For some reason, however, I’m not able to access any of the data returned by the Iterator in subsequent modules. I only see an option to retrieve a variable called Value, none of the bundled data that processed:

Screen Shot 2024-05-08 at 4.25.01 PM

I tried using the get function to pull data from the Value variable, but it keeps returning null values. What am I missing here?

Welcome to the Make community!

How is the array generated? Did you use toArray directly in the Iterator module?

Can you try replacing the “Aggregate to JSON” with a “Text Aggregator” module instead?

If you cannot select a property in the value, you might have to manually type them out.

e.g.:

{{ 14.product_id }}

If you need further assistance, please provide the following:

1. Screenshots of module fields and filters

Please share screenshots of relevant module fields and filters in question? It would really help other community members to see what you’re looking at.

You can upload images here using the Upload icon in the text editor:
Screenshot_2023-10-07_111039

2. Scenario blueprint

Please export the scenario blueprint file to allow others to view the mappings and settings. At the bottom of the scenario editor, you can click on the three dots to find the Export Blueprint menu item.

Screenshot_2023-08-24_230826
(Note: Exporting your scenario will not include private information or keys to your connections)

Uploading it here will look like this:

blueprint.json (12.3 KB)

3. And most importantly, Input/Output bundles

Please provide the input and output bundles of the modules by running the scenario (or get from the scenario History tab), then click the white speech bubble on the top-right of each module and select “Download input/output bundles”.
Screenshot_2023-10-06_141025

A.

Save each bundle contents in your text editor as a bundle.txt file, and upload it here into this discussion thread.

Uploading them here will look like this:

module-1-input-bundle.txt (12.3 KB)
module-1-output-bundle.txt (12.3 KB)

B.

If you are unable to upload files on this forum, alternatively you can paste the formatted bundles in this manner:

  • Either add three backticks ``` before and after the code, like this:

    ```
    input/output bundle content goes here
    ```

  • Or use the format code button in the editor:
    Screenshot_2023-10-02_191027

Providing the input/output bundles will allow others to replicate what is going on in the scenario even if they do not use the external service.

Following these steps will allow others to assist you here. Thanks!

samliewrequest private consultation

Join the unofficial Make Discord server to chat with other makers!

1 Like

Hi @Michael_Toth

To see the iterator values, you need to run the iterator once.

If you require additional assistance, please don’t hesitate to reach out to us.
MSquare Support | Book Live Implementation
Visit us here
Youtube Channel

1 Like

According to the screenshot above, the iterator was already run once.

1 Like

Sam, thank you for your detailed response. As you noted, I’ve already run the iterator multiple times, so that’s not the issue. I’m providing the additional details you requested, and I really appreciate your help!

I’m open to using the Text Aggregator or any other module that accomplishes my goal. That said, I’ve tried using multiple different modules, and they all seem to only have the Value variable available for mapping. I’ve tried to manually type out the property values as you suggested, but they all seem to come back as Null. It’s certainly possible I have the syntax wrong there, but I’ve experimented with different things, and I am unable to access anything from the Value variable from the iterator.

Here’s a screenshot of the array I’m trying to work with, from the first Etsy module. The array is called products, and it’s nested inside the Inventory collection:

In order to iterate over that array, I use the get function within the iterator module as follows:

This results in the following output, which I think is what I want:

Unfortunately, none of these nested variables are available in subsequent modules, only the Value variable. So, this is what I’m attempting to do to extract them, without success:

Here I’m attaching the scenario blueprint as well as the input and output bundles for the relevant modules:

blueprint (6).json (52.0 KB)

input_1.txt (50 Bytes)
output_1.txt (43.9 KB)
input_2.txt (222 Bytes)
output_2.txt (167 Bytes)
input_3.txt (4.0 KB)
output_3.txt (5.2 KB)
input_4.txt (5.5 KB)
output_4.txt (4.5 KB)
input_5.txt (2.0 KB)

Thanks again for your help!

Adding the last output bundle, as I was limited with how many I could include in the prior post:

output_5.txt (1.0 KB)

You have two options.

One, like I mentioned earlier, is to manually type the variable based on what you can observe coming out of the iterator. This saves operations.

Two, you can do a set variable with built-in functions, and then only map the array variable in the iterator. Sure it costs one more operation, but as long as you don’t use built-in functions directly in the iterator, the iterator module should output mappable variables. This fixes the cause.

2 Likes

Sam, thank you so much! I went with your second option setting the variable in a prior module using the built-in function, and it works perfectly. I wasn’t aware that using built-in functions would impact what is returned by the Iterator, but it’s good to know this workaround! Really appreciate your attention to this!

2 Likes