Generating an unique UUID identifier

Intro

You can quickly generate an unique UUID identifier in Server Connect and use it in your API Action (Server Action) steps, where required.

Generating UUID

The UUID is available in the global value in the server data picker, not as a separate step in the server action steps. So it will be available for you in every step, where you see the data picker icon - database insert, update and many others.

We will show you the generated UUID using a simple set value step.
We created an API Action:

And we add a Set Value step to it:

Add a name for the Set Value step and click the dynamic data picker for its value:

You can see the UUID just where all the rest of the global options are. Select it and click the select button:

Enable the output option for the Set Value step:

Save your API Action:

And click the preview in browser button:

And you can see the generated UUID:

4 Likes

One more custom extension we can get rid of after wait. :+1:
Is this supported in all server models?

2 Likes

Yes, it’s supported in all server models.

2 Likes

Can we modify the format, in terms of characters used, string length etc?

No, you can’t.

The format is defined in a standard, we use version 4 of uuid.

https://datatracker.ietf.org/doc/html/rfc4122#section-4.4

But can’t we use the data transformation tool to change its length once it’s been generated?!

Yes you can apply the formatters to the expressions.

1 Like

I know the chances are so tiny it’s hardly worth considering but if a uuid is generated that’s already been used, does it check and then generate another one? Or is the way it’s generated such that it’s impossible to ever generate the same one twice (like using the current time as part of it?). Sorry, I’m not familiar with uuid so this is the question that immediately came to mind when I saw it.

2 Likes

Thanks Patrick. So technically it’s possible you could have a duplicate but I stand more chance of winning the lottery hundreds of times!

1 Like

Winning the lottery hundreds of times in 1 second at 14:49:55 Friday 29 of February.

2 Likes

A post was split to a new topic: UUID error on .NET