Hi everyone,
I’m working on a Make scenario to process order line items (skus[]
), each of which may include up to 3 optional customization fields:
*gravure
(engraving)
monogramme
(monogram)surMesure
(custom size)
Input structure (from API):
I receive data in the following format:
"id": 1714
"shippings": [
{
"skus": [
{
"id": "238",
"sku": "RD-XXX",
"customisations": [
{
"title": "Gravure ..",
"content": "ghgjhgg",
"price": 0
},
{
"title": "Monogramme : ...",
"content": "ts",
"price": 10
}
]
},
{
"id": "233",
"sku": "KSM-F",
"customisations": [
{
"title": "Gravure ...",
"content": "jkhjljlbk",
"price": 0
},
{
"title": "Monogramme : ...",
"content": "lk",
"price": 10
},
{
"title": "Taille Sur-Mesure...",
"content": "taille 19",
"price": 0
}
]
}
]
}
]
So, each SKU can have 0 to 3 customizations inside a customisations[]
array.
Scenario structure:
Here’s what I’ve built so far:
- Iterator 1: on
skus[]
- Set variable:
id_ligne = order_id + "_" + index
- Iterator 2: on each
sku.customisations[]
- 3 Set variable modules to extract:
gravure
:if(contains(title; "Gravure") and content != emptystring; content; null)
monogramme
: same logicsurMesure
: same logic
- Set multiple variables with:
id_ligne
,gravure
,monogramme
,surMesure
- Filter to remove fully empty lines
- Array Aggregator grouped by
id_ligne
to build one line per SKU
Expected output:
I want to get this final JSON structure:
[
{
"key": "1714_1",
"gravure": "ghgjhgg",
"monogramme": "ts",
"surMesure": null
},
{
"key": "1714_2",
"gravure": "jkhjljlbk",
"monogramme": "lk",
"surMesure": "taille 19"
}
]
Each object = a single SKU
Only lines where at least one field is filled are kept
Empty fields appear as
null
Issue:
Despite using a variable like hasCustomisation
with this logic:
gravure != null or monogramme != null or surMesure != null
…and applying a filter before the aggregator, Make still includes empty lines (with all 3 fields null). It seems the filter works at the bundle/operation level, not at the item level from the nested Iterator.
What I’m looking for:
- How can I reliably filter customization lines one by one, after the second Iterator?
- Aggregate only valid SKUs with at least one filled field?
- Return a final flat array of JSON objects as shown above?
Thanks in advance to anyone who can share a working logic or workaround!