22399 Posts in 6747 Topics by 2749 members
|Go to End|
22 September 2009 at 3:30pm Last edited: 22 September 2009 3:46pm
I've been searching and experimenting for a little while now without success.
I'm trying to import data from a CSV file, to my managed model.
I recently found out you can use the object->add() function to add a object to a many_many relationship (thanks to willr I think).
I'm trying to add a relationship to a newly created object with an existing one when importing. So similar functionality to the $object->add($anotherObject). But I'm unsure of the syntax (or if it's possible) in the csv file.
I've been trying things in my CSV like "Relationship.add" as a column title, then the ID of the existing object in the column...... If anyone knows how to do this, the solution would be fab. I'm going to see if I can find an example by exporting, but only the summary_fields export which makes it tricky.
EDIT: I'm adding my relationship.ID (for me it's Venue.ID) as a summary field and as a searchable field, which seems to allow it to export the id of the related object. But when reimporting the spreed sheet, SS creates new empty objects instead of associating the ID.
|Go to Top|