How to parse JSON data from spreadsheet and send to Shopify API for product creation with maped images?

Hello Make.com Community,

I hope everyone is doing well. I’m currently working on a project where I need to parse data from a spreadsheet to create new products on Shopify. Although I thought I had successfully parsed the data, I’ve run into an issue where the final array turns out to be empty for some reason.

Example data I want to parse(value of the excel cell):

[
    {
        "Data": "https://drive.google.com/uc?export=download&id=19K5XVihlxA_VBVj2bqaKUkbrfCzdS6ZZ",
        "Alternate text": "Backdrop image 'Mystic Mist' from the 'Enigmatic Elixir' collection, ideal for studio photography.",
        "Position": 1
    },
    {
        "Data": "https://drive.google.com/uc?export=download&id=1JV04ajXLFjk6WL6qRt3xQf_W819nWSyp",
        "Alternate text": "Another backdrop image from the 'Enigmatic Elixir' collection, perfect for adding magic to your photographs.",
        "Position": 2
    },
    {
        "Data": "https://drive.google.com/uc?export=download&id=1HtLPvKbj8VlZ76ej8us4rkvl47GT_F56",
        "Alternate text": "Backdrop image 'Mystic Mist' with deep, black elements adding depth.",
        "Position": 3
    },
    {
        "Data": "https://drive.google.com/uc?export=download&id=1xRgLFtaqbkaCyTOuvVt0SiTY3UUZVOj-",
        "Alternate text": "'Mystic Mist' image with high 8K resolution, ideal for professional photo shoots.",
        "Position": 4
    },
    {
        "Data": "https://drive.google.com/uc?export=download&id=1B30Ua-B8gWSNPZYz-Iga6nFlFSxUP2PP",
        "Alternate text": "'Mystic Mist' backdrop image with a 16:9 aspect ratio, fitting various formats.",
        "Position": 5
    }
]

The scenario I am testing.

The values I see after Array aggregator:


The values I see in the Shopify step:

Main Question:

So, generally speaking, my question is: Why is the final array empty despite my attempts to parse the data?

Any insights or suggestions would be highly valuable and I appreciate your time in helping me resolve this issue.

Thank you!

1 Like

The image property of the output bundle from Shopify is empty because it’s likely the names of the properties in your aggregated array don’t match up with what the Shopify “Images” field is expecting.

If you have the option to select a target structure type, it makes it easier for you to map the Images sub-properties correctly.

Here, I am using Telegram because I don’t have a Shopify account to show you how it looks like with Shopify:

Screenshot_2023-09-14_100912

5 Likes

Hello SamLiew,

Thank you for your response. I should have pasted the configuration for the aggregator. As you can see, I have chosen the target structure type as “Images.”


1 Like

Oh, I see where the problem is now…

The Shopify API “product.images” field is expecting an array containing either “src” or “attachment” properties, so it might be a bug with the Shopify module itself?

Screenshot_2023-09-14_160900

Screenshot_2023-09-14_160912

"Data": "https://drive.google.com/uc?export=download&id=19K5XVihlxA_VBVj2bqaKUkbrfCzdS6ZZ",

Could you also try this using something else:

  • Try using the Google Drive “Download a file” module and pass that data to the “Data” field

  • Use a publically-hosted image with file path ending in .jpg - and not hosted on Google Drive

2 Likes

I’m wondering how I can download an image to the buffer and then use it as the value for the ‘Data’ field in a collection array. The expected data type for the ‘Image’ field is a buffer. When I was testing my links with Curl, they were working fine. However, Make.com probably expects loaded images rather than just links for some reason as you mentioned. I will try work with Google Drive module then.

image

I have tried downloading the file using the HTTP module and aggregating the response before making the Shopify request, but the value for images still shows an empty array.

I haven’t yet tried using the HTTP module to make POST requests like I was doing with curl. However, to be honest, I would prefer to use a ready-to-go module rather than manually handling requests for every other action in the future.

I have yet to try using the Google Drive module to create this array. However, I’m beginning to think that it may not be the direct issue at hand.

EDIT:

I now realize that this approach isn’t working as I initially thought it would. Instead of aggregating HTTP responses into another array, it made 5 separate calls to Shopify. However, the array still contains at least onecollection. But on the Shopify module side, I see an empty array and no images are displayed on the site. :confused:

Your second aggregator’s source module field should probably be the iterator before the HTTP module.

Could you please share screenshots of the new module fields and filters? It would really help other community members to see what you’re looking at.

You can also export the scenario blueprint file to allow others to replicate the issue. 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

Uploading it here will look like this:

blueprint.json (12.3 KB)

If possible, could you also please provide the input/output bundles of the modules by running the scenario, then clicking the bubble on the top-right of each module, taking screenshots of, and copying the contents into this discussion thread:

Screenshot_2023-08-29_100800

This will allow others to better assist you. Thanks!

5 Likes

I noticed that in my previous attempt, the HTTP request returned a status of 500. I looked through some tutorials and tried using the HTTP GET file module type, but the behavior remained the same; the arrays weren’t working. Then, I tried using the Google Drive module, and it started to work. Now, for my final step, I want to download all the files and include them in a single Shopify ‘Create Product’ request. I tried using a second iterator and aggregator, but I always ended up with 5 lists of 1 collection.

Last state:


blueprint.json (38.0 KB)

1 Like

Ok, I’ve found a working solution. It started to function properly when I changed the module that the aggregator should aggregate on.

@samliew Thank you for helping :slight_smile:

4 Likes

Correct, that’s what I said above:

2 Likes

Yes that is true. I see It now. Still thanks :slight_smile:

2 Likes