When importing relations, the relation you want to match must already exist. Otherwise, import it first then run the import that will link the two objects.
If a limit is set on the number of set relations then the oldest relation pair will be replaced with the latest relation pair as they’re imported.
By default, existing relations are first removed and then recreated each time the import runs.
You must use the ‘Set with XPath field to provide the related object ID:
The object ID is required and must be the ID as it’s stored in WordPress (Post ID, User ID, CCT ID, etc). It’s required that you provide these IDs explicitly due to the vast number of different object types which can be configured for use in relations.
With WP All Import’s ability to run custom code, you can often automate some of that ID translation though: https://www.wpallimport.com/documentation/inline-php/
Here’s a brief example showing how you might get the IDs for a custom post type’s records when matching by Title:
Function Editor example:
function my_get_destination($title){
$destination = wp_all_import_get_page_by_title($title,"destination");
return $destination->ID ?? '';
}
Called with:
[my_get_destination({YourFieldElement[1]})]
In action: