Skip Navigation

[Resolved] Import CSV with relationship data

This support ticket is created 3 years, 9 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

Author
Posts
#1998867
import.jpg

I'm trying to make a CSV file to import lots of data into the website.

i've made two custom post_types. First "kandidaten" which are related to "partij"
My relationship_slug is "deelnemende-partij-kandidaat"

So I want this import to place all "kandidaten" which are connected to a "deelnemende-partij"

How can I manage this. I think my table head title is wrong "csv_toolset_associations_deelnemende-partij-kandidaat" see image

#1999017

Hi,

Thank you for contacting us and I'd be happy to assist.

As explained in the documentation ( ref: https://toolset.com/course-lesson/importing-content-from-csv-with-post-relationships/ ), the relationship information should be passed through the CSV file in column with the meta key "_toolset_associations_%relationship_slug%".

Based on this the correct meta key for the relationship "deelnemende-partij-kandidaat" would be "_toolset_associations_deelnemende-partij-kandidaat".

I hope this helps and please let me know if you need any further assistance around this.

regards,
Waqar

#1999033

Hi Waqar,

Thanks that is just what I needed! Still have one more question:

Is it possible when "partij" doesn't exist it will be automatic add as a new "Partij"?

#1999187

Thanks for writing back.

This extra column in the import file will only store the title of the related post as the special custom field value, which can later be used by the relationship import process to connect the related posts. It will not create new posts if they don't already exist.

You can import any "Partij" as new posts the same way as you're importing the "kandidaten" posts. You'll just have to make sure that the post title supplied through the "_toolset_associations_deelnemende-partij-kandidaat" column correctly matches.