How to Create and Reset an Auto-Incrementing Number Field

How to Create and Reset an Auto-Incrementing Number Field

You can configure a number field to auto-increment its value and reset it when it reaches a certain threshold. This feature is particularly useful in processes like creating lots or batches. 
  1. Navigate to the form builder of your preferred form and include a Number field.

  2. Create a new workflow to execute on the Validations on form submissions of the form and select the record event as Created.

  3. Click Add New Action and add the following script to the Deluge editor.
  1. //Fetch the value stored in the Number_Field and sort all records in your form based on their added time in descending order.
  2. Data = <Form_Link_Name>[ID != null] sort by Added_Time desc;
  3. //Create another variable to retrieve the value stored in the number field that was most recently added.
  4. counter = Data.<Number_Field>;
  5. //Increment the counter by one and assign it to the number field. If the counter value reaches 3, reset it to 1. This means the counter resets after processing every third record.
  6.  if(counter == null || counter ==3)
  7.  {
  8.  input.<Number_Field>=1;
  9.  }
  10.  else
  11.  {
  12.   input.<Number_Field>=counter + 1;
  13.  } 
You can also choose to hide/disable this auto-incrementing number field to prevent manual user entries. To hide this field:
  1. Create a workflow by selecting the record event as Created or Edited and the form event as Field rules.

  2. On the subsequent page, click Add New Action, choose Hide fields, set this action to run always, and select the Number field.

See How It Works


  1. Number Field


      Create. Review. Publish.

      Write, edit, collaborate on, and publish documents to different content management platforms.

      Get Started Now


        Access your files securely from anywhere

          Zoho CRM Training Programs

          Learn how to use the best tools for sales force automation and better customer engagement from Zoho's implementation specialists.

          Zoho CRM Training
            Redefine the way you work
            with Zoho Workplace

              Zoho DataPrep Personalized Demo

              If you'd like a personalized walk-through of our data preparation tool, please request a demo and we'll be happy to show you how to get the best out of Zoho DataPrep.

              Zoho CRM Training

                Create, share, and deliver

                beautiful slides from anywhere.

                Get Started Now


                  Zoho Sign now offers specialized one-on-one training for both administrators and developers.

                  BOOK A SESSION







                              Quick LinksWorkflow AutomationData Collection
                              Web FormsEnterpriseOnline Data Collection Tool
                              Embeddable FormsBankingBegin Data Collection
                              Interactive FormsWorkplaceData Collection App
                              CRM FormsCustomer ServiceAccessible Forms
                              Digital FormsMarketingForms for Small Business
                              HTML FormsEducationForms for Enterprise
                              Contact FormsE-commerceForms for any business
                              Lead Generation FormsHealthcareForms for Startups
                              Wordpress FormsCustomer onboardingForms for Small Business
                              No Code FormsConstructionRSVP tool for holidays
                              Free FormsTravelFeatures for Order Forms
                              Prefill FormsNon-Profit

                              Intake FormsLegal
                              Mobile App
                              Form DesignerHR
                              Mobile Forms
                              Card FormsFoodOffline Forms
                              Assign FormsPhotographyMobile Forms Features
                              Translate FormsReal EstateKiosk in Mobile Forms
                              Electronic Forms
                              Drag & drop form builder

                              Notification Emails for FormsAlternativesSecurity & Compliance
                              Holiday FormsGoogle Forms alternative GDPR
                              Form to PDFJotform alternativeHIPAA Forms
                              Email FormsFormstack alternativeEncrypted Forms

                              Wufoo alternativeSecure Forms

                              WCAG



                                        Create. Review. Publish.

                                        Write, edit, collaborate on, and publish documents to different content management platforms.

                                        Get Started Now







                                                          You are currently viewing the help pages of Qntrl’s earlier version. Click here to view our latest version—Qntrl 3.0's help articles.




                                                              Manage your brands on social media


                                                                • Desk Community Learning Series


                                                                • Digest


                                                                • Functions


                                                                • Meetups


                                                                • Kbase


                                                                • Resources


                                                                • Glossary


                                                                • Desk Marketplace


                                                                • MVP Corner


                                                                • Word of the Day


                                                                • Ask the Experts


                                                                  Zoho Sheet Resources

                                                                   

                                                                      Zoho Forms Resources


                                                                        Secure your business
                                                                        communication with Zoho Mail


                                                                        Mail on the move with
                                                                        Zoho Mail mobile application

                                                                          Stay on top of your schedule
                                                                          at all times


                                                                          Carry your calendar with you
                                                                          Anytime, anywhere




                                                                                Zoho Sign Resources

                                                                                  Sign, Paperless!

                                                                                  Sign and send business documents on the go!

                                                                                  Get Started Now




                                                                                          Zoho TeamInbox Resources





                                                                                                    Zoho DataPrep Demo

                                                                                                    Get a personalized demo or POC

                                                                                                    REGISTER NOW


                                                                                                      Design. Discuss. Deliver.

                                                                                                      Create visually engaging stories with Zoho Show.

                                                                                                      Get Started Now









                                                                                                                          • Related Articles

                                                                                                                          • Auto populate a field based on the selection from a lookup dropdown

                                                                                                                            Requirement   When a value is chosen from a lookup dropdown, related values are populated in the other fields of the same form. Use Case   An order management app contains a form to store order details. When the admin chooses the customer name from ...
                                                                                                                          • Create Serial Number for subform rows

                                                                                                                            Requirement Create serial numbers or auto-numbers for subform rows when a new row is added. Use Case In an employee management system, an employee can add up to five dependents. It will be easy for the employees if the dependents added in the subform ...
                                                                                                                          • Autopopulate Zoho Creator field with Zoho People data

                                                                                                                            Requirement Autopopulate Zoho Creator field with employee information stored in Zoho People. Use case Let's assume an organization named Zylker has a private library. The regular users must purchase a membership in order to access the library, ...
                                                                                                                          • Understand auto number field

                                                                                                                            Understand auto number field The Auto Number field enables you to associate a sequential numeric value to each entry your users submit through your form. The number held by this field is automatically assigned immediately after your users submit an ...
                                                                                                                          • Add auto number field

                                                                                                                            Add an auto number field to a form Open the form builder. Add an auto number field to the form. (Refer to this page to learn how to add a field to a form) Enter the required number in the window that appears, then click Done . Note: The Start Index ...
                                                                                                                            Wherever you are is as good as
                                                                                                                            your workplace

                                                                                                                              Resources

                                                                                                                              Videos

                                                                                                                              Watch comprehensive videos on features and other important topics that will help you master Zoho CRM.



                                                                                                                              eBooks

                                                                                                                              Download free eBooks and access a range of topics to get deeper insight on successfully using Zoho CRM.



                                                                                                                              Webinars

                                                                                                                              Sign up for our webinars and learn the Zoho CRM basics, from customization to sales force automation and more.



                                                                                                                              CRM Tips

                                                                                                                              Make the most of Zoho CRM with these useful tips.



                                                                                                                                Zoho Show Resources