restart entry id number

By: Francesca Di Muzio | Asked: 05/27/2024
ForumsCategory: General questionsrestart entry id number
Francesca Di Muzio asked 5 months ago
is it possible to restart the entry id counter?  or to use a different entry-id counter for a single form?  
Victor Font replied 5 months ago

No. Entry IDs are generated by the database. Formidable does not create them.

1 Answers
Rob LeVineRob LeVine answered 5 months ago
There are lots of possible answers. What is your goal (your use case)?
Francesca Di Muzio replied 5 months ago

i have some form i use for large input data for lookup fileds of other forms. I don't want the number ot these entries which we upload, use, delete and reupload a lot of times, to increase the entry-id of the other forms.

I then have one particular form i am interested in having its own entry-id order and count. At the moment, formidable form mix all entries from all form with the same counter and i see huge count numbers which are also used as "progressive" number by other programs/app

Rob LeVineRob LeVine replied 5 months ago

Yes, that is "as designed". All the entries in all the forms are stored in one table, so you can't segment or restart the ids. What you can do, however, is create your ID field in your form and you can set that to whatever you want and maintain it sequentially, etc.

Mohit Manderna replied 4 months ago

Hi! I was facing the same problem and I did the same thing of manually managing the IDs. However, is there any way that @Rob LeVine you can suggest to automate the sequence of these IDs so that there is no need to manually assign ID to every submission?

Rob LeVineRob LeVine replied 4 months ago

I created a new form just for the auto IDs. The number of fields in the form depends on whether you want the sequencing for more than one form. If you only want it for one form, you only need a single field. If you want it for multiple forms, then you'll need two fields (one for the ID and one for the form identifier). Then I created a code snippet to generate the number however you want (as simple as a number or more complicated such as a code + a number). The snippet reads the current auto ID from the auto ID form, sets that number into the user form, and increments it by one in the auto ID form. This snippet can be called either by frm_setup_new_fields_vars or frm_pre_create_entry, depending on when you want the ID generated. If you use frm_setup_new_fields_vars the value will increment even if the user doesn't save the form, so that might not work for most people.

Mohit Manderna replied 4 months ago

Hi @Rob LeVine, it looks very interesting, however, I am not a coder, so it would be maxxx helpful if you can please share a tutorial for this. Would be very grateful.

Rob LeVineRob LeVine replied 4 months ago

Writing a tutorial on this is beyond the scope of this forum. You can hire me or another developer from this list if you want. https://formidable-masterminds.com/developers-directory/

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right