0

I posted this question at https://stackoverflow.com/questions/39234531/import-multi-value-from-csv-into-field-collections but I have not got any replies yet. Below is the summary:

I have a simple csv file with 3 columns: NID|Key|List; where NID is the node id and Key was the unique value used to add field collections to the respective node. "List" is a multi-value field separated by ";".

Example (csv file):
NID,Key,List
1,2,text1;text2;text3
1,3,text4;text4
2,123,text1
...

Field collection has an entity reference field to a taxonomy plus other fields.

Field Collections:
Field1: text;
Field2: Term Reference;
Field3: Entity Reference; <-- importer/tamper not working!
...

The field collection fields were mapped correctly, except for the field that was an entity reference to a taxonomy. I configured Feeds Tamper with the Field Collection Feeds module but the entity reference list was not imported.

Does anyone has experience (suggestions) importing a multi-value field from a csv file into an entity reference field within a field collection?

  • As per my question pic shows in Programmatically get all names of an entity reference field, entity reference fields save their value as target id's, which is the id of the entity. So in order for your import to work, you need to use the id and not text (label). – No Sssweat Aug 31 '16 at 16:55
  • I have had imported to an entity field using the name not the ids, but only when the entity field was a field within the content, not when it was part of the collection field. Let me try to import using the tid to see if that works. Thanks for the quick reply!. – EMJ Aug 31 '16 at 18:07
0

Solution: using the same feeds importer's configuration but instead of importing with the standalone form, it worked once it was moved to a content type form. If a content type is selected a source is imported by creating a node of that content type.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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