gteigland VIP
Total posts: 159
23 Mar 2016 17:27

As you know I'm working on importing fields via CSV for a camera database.

  1. I created a child field for camera that links to manufacturers. That works fine for web display abd font end submission
  2. In the manfacturer table that I have already imported as a new type I am using an ID structure such as 123-ABC for updating records
  3. However when I do the csv export for cameras using &formatter=csv that cell for child field that links to manufacturer says "12"

I guess my question is how can i prepare a csv file for my cameras to link to a manufacturer when the &formatter=csv grabs an ID number that I cannot reference. IN this case it was 12. When I tried other manufactures (using front-end submission) the number changes to 10 or 15. How am I suppose to reference that child field (manufacturer) in my csv file for proper import and linking.

Last Modified: 04 Apr 2016


gteigland VIP
Total posts: 159
25 Mar 2016 14:41

Sorry just a bump to see how this can be imported properly using csv? Since my guess is that the 10 or 15 is the id number from mysql. Any advice on csv import as it relates to referencing a parent or child field in the csv.


gteigland VIP
Total posts: 159
26 Mar 2016 14:36

OK I was able to see how this works. I understand that you have to select the parent or child import (CSV does not matter but only for reference). Which means you have to do it in various chunks if they are different. Also for future refence if you have multiple child/parent field then and the combinations are different then you just import the one with the an id as an identifier to update and then do it again with the other field. Here's a screen shot to help.

http://www.awesomescreenshot.com/image/1114017/0d0484b934f3b19cdc46194794a8b600

SO FOR EXAMPLE: 1. If you have set up a child or parent field for manufactures you can only import "Manufacturer A" only items. Then do it again for "ManUfActurer B" items. So that can be tedious but seems to be the only way.

  1. I suppose if you are good with JSON you can do some sort of code import with the mysql as the csv export identifiers the parent or child using teh msql id no. Screen shot below

http://www.awesomescreenshot.com/image/1114018/901f884da3a537b75a58cc81ccef88e7

So if you hae a lot of items this will be a problem. Kind of wish you could just import using the mysql ID number since the export using this but import does not.

HOWEVER I AM HAVING AN ISSUE AND I HOPE YOU CAN FIX THIS. EVEN IF I SELECT A CHILD ITEM ON THE IMPORT IT IS NOT WORKING. IT LEAVES IT BLANK ON final IMPORT AND DOES NOT SELECT FOR THE RECORD. PARENT IS WORKING BUT NOT CHILD. PLEASE ADVISE.


Sergey
Total posts: 13,748
30 Mar 2016 12:57

gteigland PARENT IS WORKING BUT NOT CHILD.

That is because, relation connection is stored only in one direction. In js_res_record_values you can see only child type fields. Parents get that information from connection throug child field parameter.


gteigland VIP
Total posts: 159
30 Mar 2016 13:45

ok thanks that makes sense.

Wondering if there is another way to do this instead of picking the one (in my case) manfacturer at a time on the csv import. In my case I have 3000 manufactureres that I'm using as a parent for a Camera. So that would be 3000 different imports. A lot obviously. Is there way to do it with a unique identifier as ID(mysql id) or my own ID so I can still keep the linkable parent/child function but not have to import 3000 different times for each manufacturer (selection for parent).

Thanks!


Sergey
Total posts: 13,748
31 Mar 2016 13:02

I am sure it is possible to do with PHP. Unfortunately right now I do not have time to implement something like this.


gteigland VIP
Total posts: 159
31 Mar 2016 14:51

ok thanks. Is there a specific php import file that is used to create the import function that I could reference in cobalt?


Sergey
Total posts: 13,748
04 Apr 2016 15:59

The import functions of parent/child fields are in components/com_cobalt/library/php/fields/cobaltrelate.php. See onImport* functions.

Powered by Cobalt