When you set up a sequence number, it will go on indefinitely. If you want your sequence numbers to reset or be restricted to a particular year, you need to follow this guide.

Resetting a Sequence Number for the Calendar Year

Start a new section in your form. You can title it Sequence Number Logic or anything else you'd like. 

1. Create a number field called PreviousYear and enter this formula:


2. Create a number field called CurrentYear and enter this formula: 


3. Create a text field called Previous_Sequence_Num with this formula:


4. Create a text field called Current_Sequence_Num with this formula:


5. Create a number field called Final_Sequence_Num with this formula:


Here's what that whole section looks like:

Now, back in your main section, you can create the text field that will display the actual sequence number. Enter this formula:


The PO here stands for Purchase Request as an example. The output of this will be something like: PO/2017/00001. This sequence number will reset at the start of every year. 

Before you publish, go to Change Permissions, click on All Tasks on the left menu, scroll down to the section called Sequence Number Logic, and mark it as Hidden.

Resetting a Sequence Number for a Fiscal Year

Here are some instructions for if you want the sequence number to reset on a day that is not Jan 1 to align with your fiscal year. This example will be for a fiscal year from April 1 - March 31.

1. Create a new section, the same as the previous example.
2. Create a number field called Requested_Month. Enter this formula:


3. Create a date field called Start_Date and enter this formula:


This shows the start of our financial year is April 1st. If you wanted the fiscal year to start in July, enter this formula:


4. Create a date field called End_Date with this formula:


This shows that the financial year ends on March 31st. Adjust the 3 and the 31 to suit your needs.

5. Create a text field called Previous_Fiscal_Year with this formula:


6. Create a text field called Current_Fiscal_Year with this formula: 


7. Create a text field called Previous_Seq_Num with this formula:


8. Create a text field called Current_Seq_Num with this formula:


9. Create a text field called Final_Seq_Num with this formula: 


Here's what that whole section will look like:

Now, go back to your main section and create a text field for your displayed sequence number (just like the previous example). Enter this formula:


Again, the PO prefix is for a Purchase Order. You can structure this any way you'd like. 

Remember to go to the Change Permissions tab to hide your logic fields.

Did this answer your question?