Hi,
In your case, it needs custom codes. I can get your website credentials in previous ticket:
https://toolset.com/forums/topic/display-a-multiple-instance-text-field-as-radio-field-in-the-post-form/#post-1130477
And have setup a demo in your website, here are detail steps:
1) Create a post view, get all "Current user accommodation posts"
hidden link
filter by:
Select posts with the author the same as the current logged in user.
https://toolset.com/documentation/user-guides/filtering-views-query-by-author/
In the view's loop output data as JSON format:
...
<wpv-loop>
[wpv-item index=1]{"value":"[wpv-post-id]","label":"[wpv-post-title]"}
[wpv-item index=other],{"value":"[wpv-post-id]","label":"[wpv-post-title]"}
</wpv-loop>
...
Enable option "Disable the wrapping DIV around the View"
2) Edit the post form "New Room"
hidden link
Setup a generic select field to replace default parent selector:
[cred_generic_field type='select' field='parent-accommodation-post']
{
"required":0,
"default":["111"],
"persist": 1,
"options":[[wpv-view name="current-user-accommodation-posts"]]
}
[/cred_generic_field]
Use view's shortcode(step 1) as the options
https://toolset.com/documentation/user-guides/cred-shortcodes/#cred_generic_field
3) when user submit the form, we need to setup the relationship between "room" post and "accommodation" post, add custom codes in your theme file "functions.php":
add_action('cred_save_data', 'relate_accommodation_room_func',10,2);
function relate_accommodation_room_func($room_id, $form_data)
{
// if a specific form
$form_ids = array(26474);
if (in_array($form_data['id'], $form_ids))
{
if (isset($_POST['parent-accommodation-post']) && !empty($_POST['parent-accommodation-post']))
{
$accommodation_id = $_POST['parent-accommodation-post'];
// relate those two posts
toolset_connect_posts('acc-room', $accommodation_id, $room_id);
}
}
}
The relationship slug "acc-room" is defined as repeatable field group slug, you can get it here:
hidden link
find the option "Group slug"
More help:
https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data
https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/#toolset_connect_posts
Please test again, check if it is what you want.