Product relation for Magento 2

Hello, i have a csv file with product relation data for my Magento 2 website


file structure:


productId: Parent product ID

referencedProductId: Child product ID

typeId: Id type (in my case, PUID)

type: relation type (up-sell, cross-sell or related)


My issue is that i can have several lines with same id in my csv file because a product can be associed to several others products.


See my first attachement


My objectif is:


Have just one line by productId and have all resullt in referencedProductId separated by comma.


See my second attachement


Thank you in advance for your help.

Hello,


you can use the group function of SpreadsheetMapper step (Settings -> Group by Column name = productId).


After saving the group by column settings, you can select a "Column Aggregate function" in referenceProductId column. Please select "Concat all values" and Value Delimiter = , to get a comma separated list of all values.

Thank you for your support!

Work fine!