How to generate a UUID

Do we have any way to generate a UUID (v4) from a value, e.g. by using a mapper?
Edit: I found a String:hash mapper, but I cannot find UUIDv4 algorithm…

What I want to achieve is to create a Primary key for a Shopware entity like this:

Hi @kjetil

Unfortunately, there is no such feature at the moment. However, we have already been aware of this requirement, and it’s in our backlog now.

Could you please let us know whether this issue is blocking your integration? If so, you could use public APIs, such as Online UUID Generator Tool to generate a UUID. It might not be an ideal solution, but it could be a workaround for you to proceed further with the integration.

I tested the Shopware API and it accepts a simpler ID as well - just doing string:hash md5 of my key (e.g. 1234 → 81dc9bdb52d04dc20036dbd8313ed055). So that’s good (not blocking integration)! :slight_smile:

This way even suits me better since I can regenerate the ID the same way at any time, so if I first created it from an Akeneo entity, then on later updates I will “know” the Shopware ID based on my Akeneo ID etc.

1 Like

Thank you for letting me know that it’s not blocking your integration.

Regarding the UUID generator, I will let you know once I have an update.