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.
- Navigate to the form builder of your preferred form and include a Number field.

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

- Click Add New Action and add the following script to the Deluge editor.
- //Fetch the value stored in the Number_Field and sort all records in your form based on their added time in descending order.
- Data = <Form_Link_Name>[ID != null] sort by Added_Time desc;
- //Create another variable to retrieve the value stored in the number field that was most recently added.
- counter = Data.<Number_Field>;
- //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.
- if(counter == null || counter ==3)
- {
- input.<Number_Field>=1;
- }
- else
- {
- input.<Number_Field>=counter + 1;
- }
- }
You can also choose to
hide/
disable this auto-incrementing number field to prevent manual user entries. To hide this field:
- Create a workflow by selecting the record event as Created or Edited and the form event as Field rules.

- 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
- Number Field