We've stabilized the Amazon inventory flow by updating the data standard. Here’s a brief summary of the fix.
Initial Issue: Inventory was either **not syncing or duplicating listings**.
Technical Block: The Saved Search was forced to handle highly conditional, multi-line output (up to 4+ FBM aliases) while excluding the Parent SKU. NetSuite could not process this complex filtering reliably, leading to the **Parent SKU being incorrectly duplicated** alongside valid aliases.
Action Taken: **Devon cleaned up all listings** to enforce a **single FBM alias maximum** per Inventory Item.
Impact: This standardization eliminated the need for complex, error-prone filtering.
Goal Reminder: The key objective is to ensure the Saved Search output provides a **perfect 1:1 match** for the SKU Amazon expects.
Logic: **If FBM alias exists, return the Alias Name. If not (only FBA or no aliases), return the Parent SKU.**
Result: Only one correct record is passed to the Celigo flow, resolving the duplication issues.
This formula implements the priority logic while ensuring the Parent SKU is always returned in a clean format (without matrix prefixes) for Amazon.
CASE
WHEN {custrecord_celigo_etail_alias_par_item.name} IS NULL
THEN CASE NVL2(REGEXP_REPLACE(REGEXP_SUBSTR({name},': [^:]+*$'),': ',''),1,2)
WHEN 2 THEN {name}
ELSE REGEXP_REPLACE(REGEXP_SUBSTR({name},': [^:]+*$'),': ','')
END
WHEN {custrecord_celigo_etail_alias_par_item.custrecord1} = 'F'
THEN {custrecord_celigo_etail_alias_par_item.name}
ELSE CASE NVL2(REGEXP_REPLACE(REGEXP_SUBSTR({name},': [^:]+*$'),': ',''),1,2)
WHEN 2 THEN {name}
ELSE REGEXP_REPLACE(REGEXP_SUBSTR({name},': [^:]+*$'),': ','')
END
END