Create Serial Number for subform rows

Create Serial Number for subform rows


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 are numbered automatically.

Steps to follow

1. Create the forms with the following details:
Form Link Name
Field Type
Field Name
Field Link Name
Add Dependents
N ame
Drop down
Date Of Birth
Add Employee
Official Email
Subform (Add Dependents)
D ependents - You can add upto 5 Dependents.
Multiple fields can be added to the Add Employee form. We have added a smaller number for brevity.
3. Now, let's create a workflow to disable the S.No field in the Add Dependents subform during the load of the Add Employee form.
4. Add the below Deluge code in the editor:
  1. disable Dependents.S_No;

5. Now, let's create a workflow to calculate the serial number for the subform rows.

6. Add the below code in the Deluge editor:
  1. //Set the number of subform rows to 0
  2. recCount = input.Dependents.count();
  3. // Inform the employee that only 5 dependents can be added
  4. if( recCount == 5 )
  5. {
  6.   alert "This is the last dependent you can add. Please note that if you want to add a dependent, you have to remove one.";
  7. }
  8. //Set the current row's S.No value to the recCount
  9. row.S_No =recCount;
When a new subform row is added, the S.No field gets populated.

See how it works


Points to Note

  • Auto-number fields are not allowed inside subforms, so that there is no confusions when subform records are inserted. 

    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

            Get started with Zoho Sign

            in a few quick steps!

            Download Help Guide

                        Still can't find what you're looking for?

                        Write to us:



                          Zoho Marketing Automation

                            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 SalesIQ Resources

                                                    Zoho TeamInbox Resources

                                                            Zoho DataPrep 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

                                                                                      • Add subform rows with dynamic data from another subform

                                                                                        Requirement             Automatically add rows to a subform and populate it with dynamic data fetched from another subform. Use Case   A form named Orders Database contains customer details and their frequent orders in a subform. We have another ...
                                                                                      • Display subform's report in parent form's report

                                                                                        Requirement   When the user views a particular record in a report that has subform, the values in the corresponding records are also shown. Use Case   An order management application contains two forms: Customers and Orders. The Customer s form is ...
                                                                                      • Auto-calculating values on a subform's field

                                                                                        Requirement Perform statistical operations on the numerical fields in subforms for analysis. Use Case  In an order management application, there are two forms, Order and Product. The Product form lists all the products in the inventory and the Order ...
                                                                                      • Understand subform field

                                                                                        The subform field enables you to display a form within a form. The form in which you add a subform is referred as the main form. Refer to the following sections to learn about subforms: Appearance When to use this field Adding a subform Features ...
                                                                                      • Create by importing data

                                                                                        Create a form by importing data 1. Preparing your source file Zoho Creator supports importing data from .xls, .xlsx, .xlsm, .csv, .tsv, .ods, .accdb, .mdb, .json and .numbers file formats. However, it's best you prepare your data by referring to the ...
                                                                                      Wherever you are is as good as
                                                                                      your workplace



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


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


                                                                                        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