Generate unique number while POST operation.

We want to automatically generate a random unique number(id) for an entity while doing a POST operation(REST API) in browser using Swagger UI. I have written a code in javascript using nanoflow, but in domain model, I can’t use that for calculated value as it only accepts microflow? How can I generate unique Long number while doing POST operation?
1 answers

You can use random() function in a microflow or nanoflow. This creates a random number between 0 and 1. You can then multiply this number as per you limit.

For example:

round(random() * 10)

will generate an integer number between 0 and 10