Hi @greenrooster,
Thank you for contacting us.
The feature you are describing is currently not available. The good news is this has been added as a feature request already, so our Plugin team is looking into to consider it for a future release. As a possible workaround, you may try the following snippet as an MU plugin or in theme’s function, which uses a hidden field that will allow to add an incremental ID for each submission:
add_filter(
'forminator_custom_form_submit_field_data',
function( $field_data_array, $form_id ){
// We're using a custom macro <code>AUTOINCREMENT_INT</code> set as value for a field.
// Make sure you add this value only in hidden fields
$needle = 'AUTOINCREMENT_INT';
$incremental = get_post_meta( $form_id, 'autoincrement_int', true );
$update_meta = false;
foreach ( $field_data_array as $key => $field_data ) {
if ( isset( $field_data[ 'value' ] ) && $needle === $field_data[ 'value' ] ) {
if ( ! $incremental ) {
$incremental = 1;
} else {
$incremental++;
}
$field_data_array[$key][ 'value' ] = $incremental;
$update_meta = true;
}
}
if ( $update_meta ) {
update_post_meta( $form_id, 'autoincrement_int', $incremental );
}
return $field_data_array;
},
20,
2
);
In order to make this work, add a hidden field to the form and make the hidden field’s Default Value to Custom and add this macro as value AUTOINCREMENT_INT.
That should create a new post meta that will hold that value. Initially (it will be empty) and then it will set it to 1(you can change the 1 in Snippet to a different starting value). Then on each submit it should increment by one.
Best,
Jonathan S