0

I am trying to import a node reference in my users's profile using feed and feeds profile modules and using a CSV file like this:

"Name","Email","Team"
"Pepe","Pepe@example.com","Team A"
"Juan","Juan@example.com","Team B"
"Pedro","Pedro@example.com","Team C"

My mapping configuration is like this:

SOURCE         | TARGET                                        | TARGET CONFIGURATION
Name             User name (name)                                Used as unique
Email            Mail                                            Used as unique
Team             team nid nid (profile2:main:field_team_nid_nid)

Team is a node reference to a content type that I had created. When I try the import y receive this error message:

Invalid data value given. Be sure it matches the required data type and format.
  • I think the feed is expecting a node id for Team while you are delivering a textual value "Team A", etc. Is "Team A" the node title of the referenced node and have you already created these nodes? – Stefan Korn Feb 4 '16 at 14:45
  • Thank for your help. Yes it is. I created a content type named "Team" and I made 3 nodes of Team named "Team A" , "Team B" and "Team C". I need that my users are related with a node Team (e.g. "Pepe" who is from "Team A"). If I make a new user account manually I can choose his Team without problem, but I need to import a lot of users which I have in a CSV file. – Alvaro Arjona Feb 4 '16 at 18:07
  • You should try with the node id of the Team nodes instead of the node title in the import. This should work. If it is not feasible to change the import you could maybe go with drupal.org/project/feeds_tamper to change while importing. – Stefan Korn Feb 4 '16 at 19:04
  • I need that my users are related with a node Team (e.g. "Pepe" who is from "Team A") are you using Entity Reference of bundle User for this? – No Sssweat Feb 5 '16 at 7:11
  • Stefan Korn I can´t do it with node id because I only have the node title in my CSV file. – Alvaro Arjona Feb 5 '16 at 8:17
0

The feed was expecting a node id and I was delivering a text value. I replaced the text value for node id corresponding in the CSV file and it works. I had to looking for node id value using phpmyadmin.

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.