- 20 Dec 2021
- 2 Minutes to read
- Print
- DarkLight
ID Generation
- Updated on 20 Dec 2021
- 2 Minutes to read
- Print
- DarkLight
Overview
ID Generation steps are used to generate unique IDs for records. For instance, unique IDs are used for Process Folder Records.
For more information on Process Folders, go to Setting Up a Proces Folder.
Creating New ID Generation Key
ID Generation Keys can be found under System>System Data>ID Generation. By default, the following ID Generation Key is provided: "ID Generation Key:R-".
New ID Generation Keys can be made by using ID Generation steps found in a Flow designer.
In a Flow Designer, navigate to the Step Tab on the right panel. Under Integration>Internal Services> IDGeneration users will find the steps for generating IDs.
Get Next ID
This step will create a new ID Generation Key. The only input it requires is a "Prefix". The default Output is "Prefix+number". This setting cannot be modified with this step.
Get Next ID Fill With Pad Char
Get Next ID Fill With Pad Char step can also be used to generate ID, but it has a more customized configuration compared to the Get Next ID step. The inputs required for this step are: "Length", "Pad Char", "Prefix".
For the example below, the Length was set to 10, **Pad Char **was set to '$', and Prefix was set to"CD".
Please note that these steps will create the first ID if there is not one with that Prefix.
Resetting Counter for ID Generation
In some use cases, Users will want to reset the counter for the ID. Navigate to System > System Data > ID Generation.Find the "ID Generation Key" that corresponds to the prefix defined in the IDs that need to be reset. Right-click and select Edit.
Edit the object and reset the ID property to “0”. Any ID prefix generated for these objects will now continue to count from the set value.
Get Next Number
Alternatively to the Get Next ID step, users may utilize the Get Next Number step. This step operates by generating a sequence for the user-defined prefix in SQL Server.
The step interacts with SQL Server by increasing the prefix sequence's value each time the step is ran. The step's interaction with SQL Server helps prevent the possibility of duplicate IDs from being generated.
Glossary Entry
Step Name | Description | Location | Inputs/Outputs |
---|---|---|---|
Get Next Number | Generates an increase numerical value (Int32) for the user input prefix. Interacts with SQL Server to prevent duplicate Output. | Integration > Internal Services > IDGeneration | Inputs: prefix [String] Outputs: Output [Int32] |
Use Case: Used to generate numerical ID variables. Can be useful for assigning a Unique ID to a user within an environment.
Example
To use and configure the Get Next Number step:
- From the Flow Designer, navigate to Steps > Integration > Internal Services > IDGeneration.
- Attach a GetNextNumber step to the Start and End steps.
- From the Properties of the Get Next Number step, provide a String value under the prefix Input.
- Save the Flow, then click Debug on the Top Action Bar. Then select FULL.
- From the Debugger, select Get Next Number > View Input/Output Data; verify that the step has Output an Int32 value.