Skip to main content
18-Opal
September 15, 2025
Question

GUID Generation in Expression

  • September 15, 2025
  • 3 replies
  • 655 views

Hi, 

 

Is it possible to generate a GUID in the Expression?, I remember seeing it long back in a Project, not sure what the correct syntax is to do it. 

 

In my stiuation I am tring to avoid the service. 

 

Thingworx: 9.4

 

Thanks,

3 replies

18-Opal
September 15, 2025

Hey,

 

self.crypto.randomUUID()

 

...and ignore the warning about unsupported object.

 

Note that it only works when your ThingWorx is served over HTTPS or from localhost.

 

/ Constantine

Community Manager
September 22, 2025

Hi @pshashipreetham 

 

If you found the response from Constantine helpful, please mark it as the Accepted Solution for the benefit of other community members.

 

If you still have questions, please let us know.

 

Regards.

 

--Sharon

16-Pearl
November 8, 2025

Hi Shashi,

 

I just gave this a try using the line noted by @Constantine and this worked as expected in ThingWorx Platform 9.5. 

 

Could you please give us some more information on what (if any) messages you are getting in the console when attempting to execute this Expression? On that note, could you also let me know how you are ensuring the Expression is being fired? In my test, I fired it by clicking a button and associated the output with a label:

output = self.crypto.randomUUID();