Generate a GUID

  • 18 September 2013
  • 4 replies


Does anyone know whether it is possible to generate a GUID in a smartforms? I see that you can define e.g. a datalabel with type AutoGuid, but can this be used to trigger such a generation? Or do I have to do this via a SmartObject?



4 replies

The AutoGUID is similar to the  Autonumber, it takes on the role of an identity type field where a GUID will be auto generated when a record is created. So effectively the guid is created behind the scenes when a record is created

I had the same problem. I missed the step of set default value of GUID field in database as (newid()). Once I added that to the GUID field in the table and updated the corresponding smart object. That property in smart object changed to autoGUID. 


You can generate a GUID in K2 by using one of the System SmartObjects.

It is in System\Management\SmartObjects\SmartObjects and is called Common.NewGuid.

It has a single Read method that returns a GUID.

Generating a GUID using the Read method of the Common.NewGuid SmartObject in the K2 Five Management Portal.


Userlevel 1
Badge +4

There is no smartobject or function to generate guid in K2 Blackpearl 4.7, you need to create your own advanced smartobject (SQL Server)