cancel
Showing results for 
Search instead for 
Did you mean: 

Incrementing Unique ID for a document

Mark_Lumsden
Champ in-the-making
Champ in-the-making

Hi, Is there any method in Nuxeo Server to give each document a unique and incrementing ID when it is created? Not to replace the unique ID that is given by default, but an additional field like:

doc01 -> uniqueID = ef42fj... and incrementID = 00001 doc02 -> uniqueID = 42ab2.. and incrementID = 00002 [....] doc0N -> uniqueID = 9f2bc.. and incrementID = 0000N

Regards, Mark

2 REPLIES 2

Gregory_Carlin
Elite Collaborator
Elite Collaborator

Hello,

You can use the one function available in automation Fn.getNextId. So you can use it on a SetProperty operation setting a value as @{Document["prefix:property"]}-00@{Fn.getNextId("my_counter")} for example where "my_counter" can have any value (it is just the counter name, useful if you have several counters).

Regards

Mark_Lumsden
Champ in-the-making
Champ in-the-making

Hi Gregory,

Getting started

Attention: Blogs & Forums are in READ-ONLY mode from Oct 9-19 as we transition to our new platform. Learn more.

Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.