Viewing 4 replies - 1 through 4 (of 4 total)
  • Hey @2204media – Thanks for reaching out!

    To help you get started, you can consider using following code snippet:

    function wpf_dev_update_total_field( $fields, $entry, $form_data ) {
        // Only run on my form with ID = 15092
        if( $form_data['id'] != 15092 ) {
            return $fields;
        }
    
        // Count the entries so far and increment the hidden field count by 1 on each submit
        $entry_count = wpforms()->entry->get_entries( array( 'form_id' => 15092 ), true ) + 1;
        $formatted_count = sprintf('%03d', $entry_count);
        $fields[3]['value'] = 'abc-' . $formatted_count;
    
        return $fields;
    }
    add_filter( 'wpforms_process_filter', 'wpf_dev_update_total_field', 10, 3 );

    In the above code, please be sure to replace form and field ID.

    This is how the result should show on the confirmation page when you add the code.

    Kindly,

    Thread Starter 2204media

    (@2204media)

    Hi @prashantrai, Thanks for your reply.

    I’m not sure you you fully understood my request, so let me explain further.

    I want to use the unique ID smart tag as a default value in a visible field. I want it to be visible when printing any entry. The form will only be filled by admin so they know that they should not adjust the value while filling the form.

    I hope this explanation helps. Thanks

    • This reply was modified 1 year, 11 months ago by 2204media.

    Hey @2204media – I apologize as customizations like this are outside of our scope for support. In case you’d like to look into custom development options, we highly recommend using Codeable.

    Thanks!

    Hey @2204media,

    We haven’t heard back from you since my previous message, so I’m going to go ahead and close this thread for now. But if you’d like us to assist further, please feel welcome to continue the conversation.

    Thanks!

    • This reply was modified 1 year, 11 months ago by Prashant Rai.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘WPForms Smart Tag for Sequential Unique ID for Each Form Entry’ is closed to new replies.