Skip to main content
pshashipreetham
19-Tanzanite
Sep 15, 2025 7:41 AM UTC
Question

GUID Generation in Expression

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
Sep 15, 2025 9:12 AM UTC

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

Translate
Support
Sep 22, 2025 1:55 PM UTC

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

Translate
16-Pearl
Nov 8, 2025 12:02 AM UTC

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();

 

Translate