To get a v4 UUID in DataWeave we must use the function uuid from the dw::Core module. The function simply returns a value that is created using random numbers. So each time we invoke the function we will get a different value.

In the following example we invoke the uuid function to get a value:

Source

%dw 2.0

output text/plain
---
uuid()

Output

608c2c26-802a-4fca-9e9d-23931420fed1

Written with DataWeave 2.4.

DataWeave is a functional language designed by MuleSoft for transforming data structures defined in for example JSON, XML or CSV.
shadow-left