Thank you for sharing this information.
Based on your workflow, I'll recommend registering a custom shortcode, which can cycle through all the intermediary posts, and then update its parent and child post titles, in the respective custom fields:
add_shortcode('update_intermediary_post_fields', 'update_intermediary_post_fields_func');
function update_intermediary_post_fields_func($atts) {
// process shortcode attributes
$intermediary_post_slug = $atts['intermediary_post_slug'];
$relationship_slug = $atts['relationship_slug'];
$field_for_parent_slug = $atts['field_for_parent_slug'];
$field_for_child_slug = $atts['field_for_child_slug'];
// get all available intermediary posts
$args = array(
'post_type' => $intermediary_post_slug,
'posts_per_page' => -1,
'post_status' => 'publish',
);
$posts_array = get_posts( $args );
// cycle through all intermediary posts
foreach ($posts_array as $post) {
// get the related parent and child posts of the current intermediary post
$get_results = toolset_get_related_posts( $post->ID, $relationship_slug, 'intermediary', 1, 0, array(), 'post_object', 'all' );
// update the titles of the parent and child posts, in the respective custom fields
update_post_meta( $post->ID, $field_for_parent_slug, $get_results[0]['parent']->post_title );
update_post_meta( $post->ID, $field_for_child_slug, $get_results[0]['child']->post_title );
}
}
The above code snippet can be included through either Toolset's custom code feature ( ref: https://toolset.com/documentation/adding-custom-code/using-toolset-to-add-custom-code/ ) or through the active theme's "functions.php" file.
Once the relationship information has been imported and the intermediary posts have been created (but before exporting them in a CVS file), you can create a new temporary page and add this shortcode to it:
[update_intermediary_post_fields intermediary_post_slug="servicio-localidad" relationship_slug="servicio-localidad" field_for_parent_slug="wpcf-servicio-post-intermedios" field_for_child_slug="wpcf-localidad-post-intermedios"]
Please note how the shortcode attributes are used to pass the information about the slugs of intermediary post type, relationship, and the fields for the parent and child post titles.
Visit the page on the front-end once and a shortcode will run in the background to update the custom field values and you'll be able to export the intermediary post data.
As for connecting a new "Service" post with all available "Locations" by default, there is no built-in feature available for this, so you'll need another custom shortcode similar to the one shared above to do this processing, programmatically.
Note: The custom code examples from our forum are shared to get you started in the right direction. You're welcome to adjust them as needed and for more personalized customization assistance, you can consider hiring a professional from our list of recommended contractors:
https://toolset.com/contractors/