# How to generate a UUID

**URL:** <https://forum.alumio.com/t/how-to-generate-a-uuid/657>\
**Category:** Mappers\
**Tags:** data-transformer\
**Created:** [June 29, 2023, 10:41am UTC](https://forum.alumio.com/t/how-to-generate-a-uuid/657 "2023-06-29T10:41:47Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![Gugi](https://forum.alumio.com/user_avatar/forum.alumio.com/gugi/32/236_2.png) [@Gugi](https://forum.alumio.com/u/Gugi)\
**Post date:** [January 3, 2025, 9:18am UTC](https://forum.alumio.com/t/how-to-generate-a-uuid/657/6 "2025-01-03T09:18:47Z")

</div>

Hi @tdhollander @kjetil,

Unfortunately, there is no update yet for the functionality to generate the GUID/UUID in Alumio. However, since we now have [Code Transformer](https://forum.alumio.com/t/code-transformer/1308), we can now generate UUID using JavaScript, as shown below.

 ![image](https://alumio-forum.s3.dualstack.eu-central-1.amazonaws.com/uploads/original/2X/a/a2ff7eac58ff2fe83c4514718c73b7e1e159e019.png)

Below is the code to generate the UUID:

```auto
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (l) => l === 'x' ? (Math.random() * 16 | 0).toString(16) : ((Math.random() * 16 | 0) & 0x3 | 0x8).toString(16));

```

Please give it a try and let us know if it works.

---

_[View the full topic](https://forum.alumio.com/t/how-to-generate-a-uuid/657)._
