Hi everyone. I would appreciate your help on a certain issue which I have. After auto-populating a repeater, changes I make inside the repeater fields afterwards are not saved except for the auto-populated fields. I am using the code below to auto-populate:
add_filter('frm_setup_new_fields_vars', 'frm_auto_populate_repeating_fields', 20, 2);
function frm_auto_populate_repeating_fields( $values, $field ) {
if ( $field->id == 331 && isset($_GET['request']) && $_GET['frm_page'] != 2 ) {
$source_entry_id = intval($_GET['request']);
$url = 'https://mysite.com/wp-json/frm/v2/entries/'.$source_entry_id;
$entryData = getRequest($url);
$entryArray = json_decode($entryData, TRUE);
$procuredItems = $entryArray['meta']['procured_items'];
$first_field = 320;
$second_field = 323;
$third_field = 322;
$values[ 'value' ] = array(
'form' => '10',
'row_ids' => array( implode(', ', range(0, count($entryArray['meta']['procured_items']) - 2)) ),
);
$i = 1;
foreach($procuredItems as $key=>$value) {
if ($key != "form"){
$title = $value['procured_item_name'];
$quantity = $value['procured_item_quantity'];
$desc = $value['procured_item_description'];
$values[ 'value' ][$i-1] = array( 0 => '', $first_field => $value['procured_item_name'], $second_field => $value['procured_item_quantity'], $third_field => $value['procured_item_description'] );
$i += 1;
}
}
}
return $values;
}
Attached is an image of the form showing other fields I would like to fill manually but they're being saved as empty even after I enter something!