Elias,
Try using the property fixedLength while creating the generator. I have created a generator with the following payload
[
{
"name": "DIP_PROTOTYPE_SAMPLE_GENERATOR_01",
"type": "SEQUENTIAL",
"valueType": "DECIMAL",
"rangeStart": "000000001",
"step": "1",
"fixedLength" : 9
}
]
Now, If I run the Get Next Reserved Value API, I will get the value as 000000001
This should satisfy your use case. Let me know if you have any follow-up question.
------------------------------
Diparnab Dey
Technical Consultant
Reltio
Kolkata, West Bengal
------------------------------
Original Message:
Sent: 01-08-2025 12:04
From: Elias Moskona
Subject: How to Create an Auto Generated ID with Prefix
Hello, is there a way to creat zero-padding for the ID?
I would like my ID to be something like "MDM0001" for the first one, and then increase to MDM0002, 0003, etc. Currently with the solution provided above they start at MDM1, MDM2...
Thank you.
------------------------------
Elias Moskona
WEX
Original Message:
Sent: 12-25-2022 08:15
From: Gowthamprabhu Sivaraj
Subject: How to Create an Auto Generated ID with Prefix
Hi Eren,
You can add AutoGenaration pattern like this,
"autoGenerationPattern": "KRM{value}",
So it would be something similar to this,
{
"label": "ID",
"name": "ID",
"description": "Auto generated KRM ID",
"type": "String",
"hidden": false,
"important": false,
"system": false,
"searchable": true,
"autoGenerated": true,
"generator": "SEQ_GEN_ABCDEDFG_ID",
"autoGenerationPattern": "KRM{value}",
"generateIfEmpty": true,
"generateIfNotEmpty": false,
"generatedValueUniqueForCrosswalk": true,
"attributeOrdering": {
"orderType": "ASC",
"orderingStrategy": "LUD"
},
"uri": "configuration/entityTypes/HCP/attributes/ID",
"skipInDataAccess": false
},