How to check if any of the given productIds exist in the list?

Hi,

I have a problem filtering orders in Make. I want to check if at least one of the given productId values is present in the list, and if so, the automation should be stopped.

My current approach:
In the Condition field, I use: {{map(1.lineItems; “productId”)}}
This returns the list of productId from the order, for example: 9374, 14326, 14327, 14328, 14329, 14331, 14332, 14333, 15751

What do I want to achieve?
I want to check if at least one of the specified products (e.g., 14326, 14321, 14334) exists in this list.

If at least one of these products exists → the automation should be stopped
Does anyone know how to correctly check if at least one of the given productId values exists in the list?

If several products are listed in the field, it doesn’t work

JSON:

[
    {
        "id": 21286,
        "status": "completed",
        "currency": "PLN",
        "version": "9.6.0",
        "total": "40.98",
        "billing": {
            "company": null,
            "city": null,
            "state": null,
            "postcode": null,
            "country": "PL",
            "email": "X@gmail.com",
            "phone": null,
            "firstName": "X",
            "lastName": "X",
            "address1": null,
            "address2": null
        },
        "shipping": {
            "company": null,
            "city": null,
            "state": null,
            "postcode": null,
            "country": null,
            "phone": null,
            "firstName": null,
            "lastName": null,
            "address1": null,
            "address2": null
        },
        "number": "21286",
        "refunds": [],
        "parentId": 0,
        "pricesIncludeTax": true,
        "dateCreated": "2025-02-27T07:16:42.000Z",
        "dateModified": "2025-02-27T07:17:37.000Z",
        "discountTotal": "0.00",
        "discountTax": "0.00",
        "shippingTotal": "0.00",
        "shippingTax": "0.00",
        "cartTax": "0.00",
        "totalTax": "0.00",
        "customerId": 0,
        "orderKey": "wc_order_rG1uGkt04IggS",
        "paymentMethod": "cashbill_blik_payment",
        "paymentMethodTitle": "Płatność BLIK",
        "transactionId": null,
        "customerIpAddress": "77.45.110.130",
        "customerUserAgent": "Mozilla/5.0 (Linux; Android 14; ThinkPhone by motorola Build/U1TBS34.54-24-1-11-4-14; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/133.0.6943.117 Mobile Safari/537.36 [FB_IAB/FB4A;FBAV/501.0.0.61.70;IABMV/1;]",
        "createdVia": "checkout",
        "customerNote": null,
        "dateCompleted": "2025-02-27T07:17:25.000Z",
        "datePaid": "2025-02-27T07:17:25.000Z",
        "cartHash": "8c79259f00a5a7a4343a5b2e53bf75aa",
        "metaData": [
            {
                "id": 29604,
                "key": "automatewoo_cart_id",
                "value": "1874"
            },
            {
                "id": 29603,
                "key": "is_vat_exempt",
                "value": "no"
            },
            {
                "id": 29611,
                "key": "_automatewoo_order_created",
                "value": "1"
            },
            {
                "id": 29615,
                "key": "_ga_tracked",
                "value": "1"
            },
            {
                "id": 29614,
                "key": "_gla_tracked",
                "value": "1"
            },
            {
                "id": 29609,
                "key": "_wcf_bump_products",
                "value": {
                    "12c": {
                        "id": "14333",
                        "price": "9.99"
                    },
                    "55f": {
                        "id": "15751",
                        "price": "1"
                    }
                }
            },
            {
                "id": 29608,
                "key": "_wcf_checkout_id",
                "value": "11982"
            },
            {
                "id": 29612,
                "key": "_wcf_fbp_checkout_tracked",
                "value": "1"
            },
            {
                "id": 29607,
                "key": "_wcf_flow_id",
                "value": "11980"
            },
            {
                "id": 29613,
                "key": "_wcf_ga_checkout_tracked",
                "value": "1"
            }
        ],
        "lineItems": [
            {
                "id": 10926,
                "name": "xxxxxx,
                "quantity": 1,
                "subtotal": "29.99",
                "total": "29.99",
                "taxes": [
                    {
                        "id": 3,
                        "total": "0",
                        "subtotal": "0"
                    }
                ],
                "sku": "ZBN-CYFR-1001",
                "price": 29.99,
                "image": {
                    "id": 17147,
                    "src": "xxxxx"
                },
                "productId": 9374,
                "variationId": 18416,
                "taxClass": "ebook_5_procent",
                "subtotalTax": "0.00",
                "totalTax": "0.00",
                "metaData": [
                    {
                        "id": 90092,
                        "key": "pa_rodzaj",
                        "value": "ebook",
                        "displayKey": "Rodzaj",
                        "displayValue": "Ebook"
                    }
                ],
                "parentName": "xxxxx"
            },
            {
                "id": 10927,
                "name": "ccccc",
                "quantity": 1,
                "subtotal": "0.00",
                "total": "0.00",
                "taxes": [
                    {
                        "id": 3,
                        "total": "0",
                        "subtotal": "0"
                    }
                ],
                "sku": null,
                "price": 0,
                "image": {
                    "id": "9398",
                    "src": "ccccc"
                },
                "productId": 14326,
                "variationId": 0,
                "taxClass": "ebook_5_procent",
                "subtotalTax": "0.00",
                "totalTax": "0.00",
                "metaData": [],
                "parentName": null
            },
            {
                "id": 10928,
                "name": "vvvvv",
                "quantity": 1,
                "subtotal": "0.00",
                "total": "0.00",
                "taxes": [
                    {
                        "id": 3,
                        "total": "0",
                        "subtotal": "0"
                    }
                ],
                "sku": null,
                "price": 0,
                "image": {
                    "id": "13561",
                    "src": "vvvvv"
                },
                "productId": 14327,
                "variationId": 0,
                "taxClass": "ebook_5_procent",
                "subtotalTax": "0.00",
                "totalTax": "0.00",
                "metaData": [],
                "parentName": null
            },
            {
                "id": 10929,
                "name": "bbbbb",
                "quantity": 1,
                "subtotal": "0.00",
                "total": "0.00",
                "taxes": [
                    {
                        "id": 3,
                        "total": "0",
                        "subtotal": "0"
                    }
                ],
                "sku": null,
                "price": 0,
                "image": {
                    "id": "9395",
                    "src": "bbbbb"
                },
                "productId": 14328,
                "variationId": 0,
                "taxClass": "ebook_5_procent",
                "subtotalTax": "0.00",
                "totalTax": "0.00",
                "metaData": [],
                "parentName": null
            },
            {
                "id": 10930,
                "name": "nnnnn",
                "quantity": 1,
                "subtotal": "0.00",
                "total": "0.00",
                "taxes": [
                    {
                        "id": 3,
                        "total": "0",
                        "subtotal": "0"
                    }
                ],
                "sku": null,
                "price": 0,
                "image": {
                    "id": "13913",
                    "src": "nnnnn"
                },
                "productId": 14329,
                "variationId": 0,
                "taxClass": "ebook_5_procent",
                "subtotalTax": "0.00",
                "totalTax": "0.00",
                "metaData": [],
                "parentName": null
            },
            {
                "id": 10931,
                "name": "mmmmm",
                "quantity": 1,
                "subtotal": "0.00",
                "total": "0.00",
                "taxes": [
                    {
                        "id": 3,
                        "total": "0",
                        "subtotal": "0"
                    }
                ],
                "sku": null,
                "price": 0,
                "image": {
                    "id": "9405",
                    "src": "mmmmm"
                },
                "productId": 14331,
                "variationId": 0,
                "taxClass": "ebook_5_procent",
                "subtotalTax": "0.00",
                "totalTax": "0.00",
                "metaData": [],
                "parentName": null
            },
            {
                "id": 10932,
                "name": "wwwww",
                "quantity": 1,
                "subtotal": "0.00",
                "total": "0.00",
                "taxes": [
                    {
                        "id": 3,
                        "total": "0",
                        "subtotal": "0"
                    }
                ],
                "sku": null,
                "price": 0,
                "image": {
                    "id": "12821",
                    "src": "wwwww"
                },
                "productId": 14332,
                "variationId": 0,
                "taxClass": "ebook_5_procent",
                "subtotalTax": "0.00",
                "totalTax": "0.00",
                "metaData": [],
                "parentName": null
            },
            {
                "id": 10933,
                "name": "uuuuu",
                "quantity": 1,
                "subtotal": "9.99",
                "total": "9.99",
                "taxes": [
                    {
                        "id": 3,
                        "total": "0",
                        "subtotal": "0"
                    }
                ],
                "sku": null,
                "price": 9.99,
                "image": {
                    "id": "14135",
                    "src": "uuuuu"
                },
                "productId": 14333,
                "variationId": 0,
                "taxClass": "ebook_5_procent",
                "subtotalTax": "0.00",
                "totalTax": "0.00",
                "metaData": [],
                "parentName": null
            },
            {
                "id": 10934,
                "name": "ooooo",
                "quantity": 1,
                "subtotal": "1.00",
                "total": "1.00",
                "taxes": [
                    {
                        "id": 3,
                        "total": "0",
                        "subtotal": "0"
                    }
                ],
                "sku": null,
                "price": 1,
                "image": {
                    "id": "14812",
                    "src": "ooooo"
                },
                "productId": 15751,
                "variationId": 0,
                "taxClass": "ebook_5_procent",
                "subtotalTax": "0.00",
                "totalTax": "0.00",
                "metaData": [],
                "parentName": null
            }
        ],
        "taxLines": [
            {
                "id": 10935,
                "label": "Podatek",
                "compound": false,
                "rateCode": "PL-PODATEK-1",
                "rateId": 3,
                "taxTotal": "0.00",
                "shippingTaxTotal": "0.00",
                "ratePercent": 0,
                "metaData": []
            }
        ],
        "shippingLines": [],
        "feeLines": [],
        "couponLines": [],
        "paymentUrl": "ppppppp",
        "isEditable": false,
        "needsPayment": false,
        "needsProcessing": false,
        "currencySymbol": "zł"
    }
]```

Thanks for your help!

This was the solution for me. I didn’t know it could be done this way. I’m switching from Zapier and Make, which is completely new to me.

3 Likes