Create ID with sequential numbers

Prev Next

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.

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

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

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

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

Screenshot 2025-07-21 at 12.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

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

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

After the function retrieves the last ID, it checks whether it exists or not.
Screenshot 2025-07-22 at 11.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

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

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

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

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

Next, the function increases the previously retrieved number by 1.
Screenshot 2025-07-22 at 11.24.03.png

Lastly, it generates the new ID.
Screenshot 2025-07-22 at 11.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

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

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

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{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