Task
Product variants use SKUs such as TSHIRT-100-RED-M and TSHIRT-100-BLUE-L. A marketplace feed needs one shared group_id without color and size.
Short answer
Create group_id from sku and keep only the prefix before the second dash with ^[^-]+-[0-9]+.
How to do it in Eofferix
Open the settings of the output
group_idcolumn and selectskuas the source.
The outline marks the group_idcolumn.Add a transformation: condition
Regular expression, value^[^-]+-[0-9]+, actionRemove everything except.
The regular expression keeps the shared part of the variant SKU. Save the template and run the transformation on the final step.
Before / after
Before
source data| sku | name |
|---|---|
| TSHIRT-100-RED-M | Red T-shirt M |
| TSHIRT-100-BLUE-L | Blue T-shirt L |
After
result| sku | group_id |
|---|---|
| TSHIRT-100-RED-M | TSHIRT-100 |
| TSHIRT-100-BLUE-L | TSHIRT-100 |