---
title: "Create ID with sequential numbers"
slug: "create-id-with-sequential-numbers"
updated: 2025-09-30T19:00:47Z
published: 2025-09-30T19:00:47Z
canonical: "support.tulip.co/create-id-with-sequential-numbers"
---

> ## Documentation Index
> Fetch the complete documentation index at: https://support.tulip.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Create ID with sequential numbers

*This function can generate running number ID*

          Who can use this feature

          
              

As of r338, Functions is in Production Early Access. To request access, contact your Customer Success manager.

**Read more in the Community thread [here](https://community.tulip.co/t/functions-production-release-available-for-early-access/15658).**

Create ID with sequential number is set up for the Common Data Model's Action table. If you would like to use this for a different table, you have to set up a Tulip Table Connector for that specific table.

![Screenshot 2025-07-22 at 10.59.18.png](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/Screenshot%202025-07-22%20at%2010.59.18.png)

- [How to Create an HTTP Connector](https://support.tulip.co/docs/how-to-create-and-configure-an-http-connector-function)
- [How to Use the Table API](/r230/docs/how-to-use-the-table-api)

## Introduction

Functions allow your team to build shared or standardized logic once, and then reuse in multiple apps. In this example we are showcasing functions which can bulk update the status field in multiple work orders.

### Function Flow

The function's flow: ![Running ID flow v2.png](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/Running%20ID%20flow%20v2.png)

### Walkthrough

Functions are triggered by a trigger in an application. In the function, you can define inputs that need to be provided by the trigger that calls the function.

In this specific function, we require two inputs. ![Screenshot 2025-07-21 at 12.41.54.png](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/Screenshot%202025-07-21%20at%2012.41.54.png)

Also, this function has an output which can be used in the application.

![Screenshot 2025-07-21 at 12.41.59.png](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/Screenshot%202025-07-21%20at%2012.41.59.png)

The first input is Prefix variable, and the second is a Length variable. These two variables are provided to the function call by the trigger. The function uses these inputs to execute. ![Screenshot 2025-07-21 at 14.01.58.png](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/Screenshot%202025-07-21%20at%2014.01.58.png)

First, the function is called by a trigger. The first action after the function is called is to generate a 20-character long ID placeholder, which corresponds to the length of an SAP ID. If your operation uses longer IDs, you can modify this ID placeholder to match your requirements.

![Screenshot 2025-07-22 at 9.39.26.png](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/Screenshot%202025-07-22%20at%209.39.26.png)

Next, the function uses a connector function to retrieve the last ID with the specified prefix from the table it is configured for.

![Screenshot 2025-07-22 at 11.05.43.png](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/Screenshot%202025-07-22%20at%2011.05.43.png)

After the function retrieves the last ID, it checks whether it exists or not. ![Screenshot 2025-07-22 at 11.07.31.png](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/Screenshot%202025-07-22%20at%2011.07.31.png)

If the ID doesn't exist, it will generate a new ID. To generate a new ID, the first step is to set the ID length to match the value provided by the "Length of ID" input. ![Screenshot 2025-07-22 at 11.10.51.png](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/Screenshot%202025-07-22%20at%2011.10.51%281%29.png)

The second step is generating the actual ID. The action uses the provided prefix, the newly specified ID length, and increments the number by one. ![Screenshot 2025-07-22 at 11.13.47.png](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/Screenshot%202025-07-22%20at%2011.13.47.png)

If the retrieved last ID exists, the function will check the length of the ID (excluding the prefix).

![Screenshot 2025-07-22 at 11.21.08.png](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/Screenshot%202025-07-22%20at%2011.21.08.png)

Next, the function checks whether the second input, the "Length of ID" number input, is empty.

![Screenshot 2025-07-22 at 11.20.05.png](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/Screenshot%202025-07-22%20at%2011.20.05.png)

If it is empty, it means that the user only wants to increment the number of the existing ID. To do this, they first need to extract the number from the ID.

![Screenshot 2025-07-22 at 11.22.54.png](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/Screenshot%202025-07-22%20at%2011.22.54.png)

Next, the function increases the previously retrieved number by 1. ![Screenshot 2025-07-22 at 11.24.03.png](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/Screenshot%202025-07-22%20at%2011.24.03.png)

Lastly, it generates the new ID. ![Screenshot 2025-07-22 at 11.26.43.png](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/Screenshot%202025-07-22%20at%2011.26.43.png)

If the Length of ID input wasn't empty the function exames whether the Length of ID is the same length as the Last ID's length. ![Screenshot 2025-07-22 at 11.29.40.png](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/Screenshot%202025-07-22%20at%2011.29.40.png)

If it is, then again, it won’t generate a new ID, but will only increment the existing one by 1. The function will extract the ID number in the same way as when the "Length of ID" input is empty, increment it by 1, and generate a new ID.

If the Length of ID is not the same as the Last ID's length the function will generate a new ID. To do so, the first step is to set the ID length to match the value provided by the "Length of ID" input. ![Screenshot 2025-07-22 at 11.10.51.png](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/Screenshot%202025-07-22%20at%2011.10.51%281%29.png)

The second step is generating the actual ID. The action uses the provided prefix, the newly specified ID length, and increments the number by one. ![Screenshot 2025-07-22 at 11.13.47.png](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/Screenshot%202025-07-22%20at%2011.13.47.png)

At the end of the function, a new ID variable is generated as the function’s output. This can be used in the

![Screenshot 2025-07-22 at 11.36.43.png](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/Screenshot%202025-07-22%20at%2011.36.43.png){height="" width=""}application as the ID for a new table record.

## Further Reading

*If you would like to get to know more functions, check out these other documents to extend your knowledge*

- [Function Overview Article](https://support.tulip.co/docs/functions)
- [Work Order Table Fields Update Function](https://support.tulip.co/docs/work-order-table-fields-update-function)
- [Work Order Status Bulk Update](https://support.tulip.co/docs/work-order-table-statues-field-update-function)
