Populate select with posts - submission doesn't include select data


This Discussion is public


Hi all,

I've created a dynamic field that is populated with posts from a custom post type called 'events'. I've got the options value and label showing the post title correctly, and all appears fine.

My problem is when the form is submitted, the chosen post isn't sent in the email notification, but is showing in the entry as selected. I've tried editing the email but the field value just doesn't come through on the email, all other fields are fine.

I've added some screenshots of the field settings, the html output, and the completed entry showing the field entered.

Would appreciate any help to fix this please... have run out of ideas.

Thanks in advance, Dan.



To get the field to populate with my post type, I've used this code:

add_filter('frm_setup_new_fields_vars', 'frm_populate_posts', 20, 2);
add_filter('frm_setup_edit_fields_vars', 'frm_populate_posts', 20, 2);

//use this function on edit too
function frm_populate_posts($values, $field){

if ( $field->id == 125 ) { //replace 125 with the ID of the field to populate

$today = date('Y-m-d');
$posts = get_posts( array(
'post_type' => 'tribe_events',
'post_status' => array( 'publish', 'private' ),
'posts_per_page' => 30,
'orderby' => 'meta_value',
'order' => 'ASC',
'meta_query' => array(
'key' => '_EventStartDate',
'value' => $today,
'compare' => '>=',

unset( $values[ 'options' ] );
$values[ 'options' ] = array( '' ); //remove this line if you are using a checkbox or radio button field

$values[ 'options' ][ '' ] = 'Select event...'; //remove this line if you are using a checkbox or radio button field
foreach ( $posts as $p ) {
$values[ 'options' ][ $p->post_title ] = $p->post_title;

$values[ 'use_key' ] = false; //this will set the field to save the post ID instead of post title
unset( $values[ 'options' ][ 0 ] );

return $values;

One thing I've just noticed further...


When looking at the entries list to like I would to export, and the event data is empty. See the screenshot.



Can anyone help with this please?

Does anyone have any ideas how I could resolve this please?

Reply to this Discussion