Grooper 21.00.0082 is available as of 12-12-2023! Check the  Downloads Discussion  for the release notes and to get the latest version.
Grooper 23.1.0016 is available as of 03-15-2024! Check the  Downloads Discussion  for the release notes and to get the latest version.
Grooper 23.00.0042 is available as of 03-22-2024! Check the Downloads Discussion for the release notes and to get the latest version.

How to generate unique Number for documents?

Hi,
How to get unique number for every document in the batch?

Example:-
Batch1:
           Document1: 001
           Document2: 002
           Document3: 003
Batch2:
           Document1: 004
           Document2: 005
           Document3: 006

Thanks & Regards,
Saisreenadh

Answers

  • GrooperGuruGrooperGuru Posts: 481 admin
    In a Calculate or Export Mapping Expression, you can use NodeIndex to obtain the position of the current document within its parent container. This use zero-based indexing. This gets you close to what you need, but the numbering would essentially start over for every batch or parent folder you encounter. For something that will continue a sequence across parent documents or batches, I would see this more being a function of a destination database with an identity column that inserts the next available number upon export of a new row. 
    Matt Harrison
    Product Manager
    mharrison@bisok.com
  • dgreenwooddgreenwood Posts: 112 admin
    You could also do this with a GUID if you're just wanting a unique ID for each document.  Every object in Grooper has a GUID already assigned to it.  One option would be to just use the GUID assigned to the document folder in the Batch.

    You could create a Data Field in your Data Model and use the "Default Value Expression" property to create a simple expression returning the document folder's GUID.  That expression is as follows:

    Folder.Id

    You could also generate a new random GUID using the following Default Value Expression:

    Guid.NewGuid
  • SaisreenadhSaisreenadh Posts: 18
    Hi @GrooperGuru@dgreenwood,

    Thanks you. But, we want unique sequence number not GUID. Is there any possibility to use SQL sequence or stored procedure to get sequence number in Grooper.

    Thanks & Regards,
    Saisreenadh
  • GrooperGuruGrooperGuru Posts: 481 admin
    @Brian any ideas on this one?
    Matt Harrison
    Product Manager
    mharrison@bisok.com
Sign In or Register to comment.