SKU Conflict and Variant Handling Problem in Product Creation Workflow

Hello,

I have a problem that I’ve been trying to solve for the past 2 days.

:dart: Workflow goal: Successfully create Printify products from Mock-Up products saved in my shop.

To achieve this, I am using a “Get a Product” module, which provides me with all the necessary information to create my new product.

Capture d’écran 2024-01-12 à 18.34.06

I can then create a new product based on the output information provided by this module:

However, when I create my product based on the Mock-Up product information, it updates correctly but also assigns the same SKU number. As a result, it creates a new product on Printify but replaces my product on my Shopify store.

I think I know where the problem comes from; it only links the variants with the variant ID and price:

Capture d’écran 2024-01-12 à 18.32.49

This works, but it only considers the first variant returned by the “GET” module and not all the variants. As a result, the created product only has one variant instead of four.

Here is the output of the “GET” module:

 "variants": [
            {
                "id": 41521,
                "sku": "37358789014584201000",
                "cost": 1312,
                "price": 1800,
                "title": "14\" × 14\"",
                "grams": 550,
                "is_enabled": true,
                "is_default": false,
                "is_available": true,
                "is_printify_express_eligible": false,
                "options": [
                    1828
                ],
                "quantity": 1
            },
            {
                "id": 41524,
                "sku": "32831341371905590575",
                "cost": 1401,
                "price": 1900,
                "title": "16\" × 16\"",
                "grams": 750,
                "is_enabled": true,
                "is_default": false,
                "is_available": true,
                "is_printify_express_eligible": false,
                "options": [
                    1831
                ],
                "quantity": 1
            },
            {
                "id": 41527,
                "sku": "61718285493791707444",
                "cost": 1573,
                "price": 2100,
                "title": "18\" × 18\"",
                "grams": 870,
                "is_enabled": true,
                "is_default": false,
                "is_available": true,
                "is_printify_express_eligible": false,
                "options": [
                    1834
                ],
                "quantity": 1
            },
            {
                "id": 41530,
                "sku": "21733478925616320339",
                "cost": 1906,
                "price": 2500,
                "title": "20\" × 20\"",
                "grams": 1000,
                "is_enabled": true,
                "is_default": true,
                "is_available": true,
                "is_printify_express_eligible": false,
                "options": [
                    1837
                ],
                "quantity": 1
            }
        ],

Here is the input for the POST module:

 {
                "variant_ids": [
                    41521
                ],

I think I know where the problem is coming from; it probably requires using an iterator to break down the IDs from the GET module and inject them into the POST module. However, with this technique, I’m stuck at this point, and I might be on the wrong track.

Any ideas ?

Hi @Frozbee

You are on right track. You need to use iterator to break the IDs and then can map in your POST module. It will create orders for each SKU.

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

2 Likes

Hi @Msquare_Automation ,

Thank you for your reply.

I have tried several times with an iterator but it was only splitting the output in 4 different bundles, and was able to retrieve the output for the first bundle only. Will try again and update this post.

Thanks

Hello,

I still can resolve this issue. Here is what i have tried:

I have use an iterator to split the output in different bundle, then an array agregator to merge the ID of all my variants, however, when i set the variable after this, only the first ID comes up.

[ { "id": 41521 } ]

Any idea ?

Regards,