5

How can we import multiple select attribute values using CSV ?

For example SKU "test" has two values for attribute "xyz" - "val1" and "val2".

When I use both value as val1<space><comma><space>val2 , import throws error:

  1. Value for 'xyz' attribute contains incorrect value, see acceptable values on settings specified for Admin rows ....

4 Answers 4

12

You can do this by just add multiple values by any separator and add that separator in Multiple value separator field. like this

val1|val2|val3

check this screenshot. https://prnt.sc/ics5ur

if you still face the issue then un-check Fields enclosure checkbox.

3
  • We had tried with a semicolon ; before and failed. It does not work with a semicolon as multiple value separator. But it does work with the pipe, thanks for the hint!
    – hey
    Apr 26, 2019 at 4:01
  • Not working in 2.3.1
    – Jaisa
    Jul 22, 2020 at 18:53
  • Not woking M2 2.4.2 Aug 6, 2022 at 0:36
1

Magento 2 - We have multiple options for separating your custom attributes like

USING COMMA

attribute_code1 = custom_attribute_value1 , attribute_code2 = custom_attribute_value2 , gon on...

USING VERTICAL BAR

attribute_code1 = custom_attribute_value1 | attribute_code2 = custom_attribute_value2 | gon on...

USING COLON

attribute_code1 = custom_attribute_value1 : attribute_code2 = custom_attribute_value2 : gon on...

We have Multiple value separator option in admin panel, below-attached screenshot for your reference

enter image description here

--- More Description -----

Magento 2 - When you are export product CSV, created product custom attributes comes under "additional_attributes" column in CSV file.

If you have multiple custom attribute, which would be separated by commas in same "additional_attributes" column

additional_attributes column in product csv file

Product 1 : attribute_code1 = custom_attribute_value1 , attribute_code2 = custom_attribute_value2 , gon on...
Product 2 : attribute_code1 = custom_attribute_value1 , attribute_code2 = custom_attribute_value2 , go on...

Finally, you can proceed with normal magento2 import process, you can see respective product attributes value is updated...

Notes : Magento 2 custom attributes value comes under "additional_attributes" column in csv file

1

I tried like following

in "additional_attributes" I put values like for my custom made multiple select attribute filter_color, filter_color=SILVER | GOLD | BLUE

Also "Fields enclosure" check box is already unchecked.

Also put "|" in "Multiple value separator" while importing.

even then the following error displayed while importing Value for 'filter_color' attribute contains incorrect value, see acceptable values on settings specified for Admin But for the rows which contains values like "filter_color=SILVER" (SINGLE VALUES) it shows correct

Please help me to resolve this.

2
  • When I removed the space near to the "|" symbol it works. Even then it is not showed in left side filter options.
    – Sreerag AS
    Jun 26, 2019 at 10:19
  • This is also resolved after doing reindexing
    – Sreerag AS
    Jun 26, 2019 at 10:31
0

It can be done by passing your multiselect attribute code and its values separated by | symbol in CSV. For example, here I'm passing different attributes of different types inside additional_attributes CSV column

date_time=7/21/23,material=cotton,size=large,usage=Travel|Sports|Office|Casual

CSV: Column with attributes in CSV

usage - multiselect attribute with various values. This attribute is already created. Import does not create attributes! During import you just assign attribute values to the imported product.

Result (imported product page with attributes in admin area): Imported product page with imported attributes

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.