sequence

To be used with Value function - Used to create a sequence in a formula: [$sequence]

sequence function used in a formula can be used to generate a sequence number. A separate sequence can be generated per asset class.

[$sequence]
This will generate or retrieve the next sequence number

It's also possible to specify the display length of the sequence using % following by the number of digits. This is optional.

[$sequence%06] Here %06 means sequence value must be having six digits.

Additionally it's possible to specify an optional starting value for the sequence using @ followed by the starting value. Currently this value can only be a number. If the sequence doesn't already exist, the generated sequence number will start with the value provided.

[$sequence@101]
Here our sequence value will start with 101

[$sequence@101%06]
If we are providing both starting value and number of display digits, then starting value should appear before the display digits.

Use sequence with 'value' function

sequence can be used in a value function to set a value from a sequence against an attribute when an asset is created or updated.

value(Condition([$attribute.A], True, eq) ? [$sequence@101%06]:null, CREATE)

Here upon creation of an asset, if Attribute A equals to True, then it value is set to a sequence number starting with 101 with a 6 digit display ex: 000101. If attribute A is not True, then a null will cause the asset create to fail.