//Update ACF field to see gallery on the front without having to update the cpt in the admin
add_action('frm_after_create_entry', 'update_my_acf_field', 30, 2);
function update_my_acf_field($entry_id, $form_id){
if ($form_id == 7) { //replace 7 with the id of the form
$latest_cpt = get_posts("post_type=portfolio&numberposts=1");
$latest_cpt_id = $latest_cpt[0]->ID;
$acf_field_name = '_galerie'; // the acf gallery field name
$automated_prefixed_key = '_'.$acf_field_name;
$acf_field_id = 'field_5ba213a60d369'; // the acf gallery field id. See Browser Inspector in admin to get it
//update_field('_name_of_you_gallery_field', 'field_value_checked_in_database', $latest_cpt_id);
update_field($acf_field_name, $acf_field_id, $latest_cpt_id);
//By default, a second entry with the same key as the name of the gallery field, prefixed with an underscore, is created. We delete it.
delete_post_meta($latest_cpt_id, $automated_prefixed_key);
}
}