Maybe you could do it as follows:
The other option is as follows:
Here is another example:
In addition to this, we also have a support article Creating Unique Serial Numbers in Forms which should help you solve your issue.