It's possible to import content that is related to one or more contentlets that already exist in the system. Content can be related on import regardless of whether the relationship exists between two different Content Types or the Content Type is related to itself.
Importing Content with Relationships
In the image shown below, a relationship field has been added on two different Content Types - Employee and Location. Several “Employees” and “Locations” have already been created as content in the system.
To import the desired content, choose the “Import Content” option instead of the add new content option on the Content Search manager.
Choose the Content Type, content language version to import, a workflow action and, if needed, download the sample .CSV file.
In the CSV file, the relationship field should be visible in the header. The relationships field can relate to one or more contentlets using the following values:
- a single or comma separated list of identifiers of the relatable content
- a single or comma separated list of Lucene queries for one or more relatable content
- a comma separated list of identifiers and Lucene queries for one or more relatable content
Then upload the file and preview the import file for errors. The import of content with relationships will fail if there are any errors in the import preview report.
Once you have imported the content with relationships, do a filter search for the related content, using the relationship field or edit a few pieces of content and verify that the relationships field has been populated with the related content data.