cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

ThingWorx Navigate is now Windchill Navigate Learn More

Translate the entire conversation x

GUID Generation in Expression

pshashipreetham
18-Opal

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,

Shashi Preetham,
+91 8099838001 | shashi@psptechhub.com,
PSPTechHub  ||  World of PTC Thingworx  ||  LinkedIn
3 REPLIES 3

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


Vilia (my company) | GitHub | LinkedIn

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

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

 

Announcements


Top Tags