Skip Navigation

[Closed] How to import CSV with relation types

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This support ticket is created 9 years, 10 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 19:00 10:00 – 19:00 10:00 – 19:00 10:00 – 19:00 10:00 – 19:00 -
- - - - - - -

Supporter timezone: Europe/Madrid (GMT+01:00)

This topic contains 11 replies, has 2 voices.

Last updated by Adriano 9 years, 9 months ago.

Assisted by: Caridad.

Author
Posts
#226798

Hi i have setup types with a relation however i want to import data from a CSV. This is not working it says no records.
I tried different slug names everything.

the header should contain : wpcf-[slugname] if am right
and below the value. But how can i import it and connected to each other as parent and children.

#226830

As i can see there is not a plain solution to import your custom type posts from a CSV. Could somebody enlight this!

#226907

Dear Chris,

Please send me this CSV file by email, I will try to import on my localhost and see how it goes. My email is adriano.f@onthegosystems.com

#228299

Adriano i have send you an email a week ago. Any news on this, i am still waiting because i want to import 27 thousands records asap

#228404

Come one isn't there anyone who can describe a simple explanation what i have to do to import data from a csv to my relation types
I have setup the following relation types with the following slugs

Relation: Kind - Make - Model - Type
Data: Car - BMW - M5 - V6 5 liter 2001

How do i setup my csv? Do i need to enter the following
In box A1(slugs?): Kind,Make,Model,Type
In box A2(data): Car,BMW,M5,V6 5 liter 2001

Please i need this information asap so that i can proceed

#228474

Dear Chris,

Please send this CSV again, I have not received yet. Please use the URL of this ticket as email's subject. I'm waiting for this file.

#228923

i have send you the mail again

#229014

Dear Chris,

I have not received this one yet. Put the URL of this ticket "https://toolset.com/forums/topic/how-to-import-csv-with-relation-types/" in the subject's email, also have sure to write to adriano.f@onthegosystems.com

#230753
test.PNG

I have send about 5 mails without any response. I have searched into the database and i hope i can make my problem more clear by explaining.

I have setup different custom types related to each other, in my case | Kind -> Make -> Model -> ModelType <- Woocommerce Product.
If i enter the information manually it works perfect. For example | Car -> BMW -> 320i -> V6 2001 3.4l -> BatterySet with Varta package

However i want to import alle the car makes and products etc into wordpress with keeping the relation as is created when entering manually.
If i look into the database i can see everything is saved in the table wp_post with a posttype reffering to the make or model.
The actually relation is set up in the table wp_postmeta so that types understand that a Model binds to the expected Make (see attachement).
When using for example CSV importer it doesn't see any relation so every item will be imported as standalone.

Can someone please tell me how and with wich fields i can import data for my custom types without losing the relation? Do i need to do something more and do i need to take into account the relation which wordpress uses.
I cannot imagine you guys didn't think about this problem when given an option to setup relations between different types. I am almost waiting a month for getting a solution for this. A tool to do this for a customer would not be a stupid idea.

#230823

Dear Chris,

We have a nice tutorial about CSV Importer, please take a look: https://toolset.com/documentation/user-guides/how-to-import-content-into-wordpress-using-csv/

As you can see there, CSV Importer allow you to import custom fields as well, stored in postmeta table. So, actually you can import the relation using this plugin. You just need to create a new column in the file and then use the field name, like _wpcf_belongs_product_id. Also fill the value of the column.

If you import the CSV file, having these columns properly filled, so everything would be held.

#230897

Well Adriano. I am finding it too hard to get it done properly. A single type i can import but several with relation in the same csv is killing. May i enlight
This is what i need as for the data.

Car - BMW - M5 - V6 3l 2001 benzine - bindingtable (Auto generated) for example accuset name: M5Battery - Varta E46 - Body text - price (the varta e46 and body and price is woocommerce product)

This is my columns from the csv file. I want to import all the above from one excel file while keeping the relation intact.

csv_post_title,csv_post_post,csv_post_type,wpcf_belongs_voertuigsoort, Then the same as before only changing the data for post type and adding wpcf_belongs_voertuig-merk etc.

Can you please describe me the names for the header columns because when i use wpcf_followedbytype name it won't import it there, instead it places the whole record in messages. Also when starting again with csv_post_title it will not import only the first set. I also tried to put it in b1 but then it won't import anything.

My customType slugs are voertuigsoort(Kind), voertuig-merk(Make), voertuig-model(Model), model-type(Type), accuset(BindTable)

So just to be sure, i want to import below (if not exist create, otherwise use the one made instead, using id's here is almost impossible due to all the different models)

Car -> BMW -> M5 -> V6 3l 2001 benzine -> 001(Bindingtable) - Varta E46 - This accu is a pro balabablabl - 17.99

#231519

Dear Chris,

When using Types posts relationships, we store the parent of a given type in a field _wpcf_belongs_{parent-slug}_id. Assume we are displaying a Car post type that usually has a parent Maker post type. Each Car will store its Maker id in the field _wpcf_belongs_maker_id: wpcf_belongs_voertuig-merk_id

You forgot to add _id in the final of the column, I think this was the problem.

The topic ‘[Closed] How to import CSV with relation types’ is closed to new replies.