Auto Generated Unique number

Hi, while adding a product , For every product in my app I want to give auto generated serial number in the format – SL1_UP_31032021_01 this number should be incremented automatically by one every time I add a new product. Can anyone help me on this?     
2 answers

You could store the last generated number in an entity. When you build the next serial number retrieve this, increment it, store it, and then use it in the serial number.

You will probably want to protect this entity by providing this functionality via a dedicated microflow that has concurrency disallowed.


You could create an entity with 1 Attribute: Autonumber.

Every time you need to generate a new unique code you can create 1 of that object( no need to commit the object).

The value of that Autonumber attribute can then be used to create your unique code: 

MyUniqueValue = ‘SL1_UP_31032021_’ + toString($TheAutonumberAttribute)