# Generating unique ID with prefix

**URL:** <https://forums.pega.com/t/generating-unique-id-with-prefix/2661>\
**Category:** General\
**Tags:** 8-7, dev-designer-studio, system-architect, data-integration, case-management\
**Created:** [May 27, 2022, 6:42am UTC](https://forums.pega.com/t/generating-unique-id-with-prefix/2661 "2022-05-27T06:42:51Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sai\_Guggilla](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/sai_guggilla/32/11575_2.png) [@Sai\_Guggilla](https://forums.pega.com/u/Sai_Guggilla)\
**Post date:** [May 27, 2022, 6:42am UTC](https://forums.pega.com/t/generating-unique-id-with-prefix/2661/1 "2022-05-27T06:42:51Z")

</div>

Hi Team,

I want to generate a unique ID with prefix and ID should be in incrementing order.

ex: ID-1,ID-2,…etc.

---

<div class="post-metadata">

**Author:** ![AkshithReddyT](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/akshithreddyt/32/23038_2.png) [@AkshithReddyT](https://forums.pega.com/u/AkshithReddyT)\
**Post date:** [May 27, 2022, 7:50am UTC](https://forums.pega.com/t/generating-unique-id-with-prefix/2661/2 "2022-05-27T07:50:02Z")

</div>

@SaiG5925 Hi, You have to make use of Work-.GenerateID activity & also have a look over here database table (PC\_DATA\_UNIQUEID)

More info can be found over here [https://collaborate.pega.com/discussion/case-id-generation-mechanism](https://collaborate.pega.com/discussion/case-id-generation-mechanism)

Thanks

---

<div class="post-metadata">

**Author:** ![uashok93](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/uashok93/32/3959_2.png) [@uashok93](https://forums.pega.com/u/uashok93)\
**Post date:** [May 30, 2022, 5:29am UTC](https://forums.pega.com/t/generating-unique-id-with-prefix/2661/3 "2022-05-30T05:29:50Z")

</div>

@SaiG5925 . This will help !! @pzGenerateUniqueID(tools, “prefix\_here”)

---

<div class="post-metadata">

**Author:** ![AkshithReddyT](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/akshithreddyt/32/23038_2.png) [@AkshithReddyT](https://forums.pega.com/u/AkshithReddyT)\
**Post date:** [May 30, 2022, 5:53am UTC](https://forums.pega.com/t/generating-unique-id-with-prefix/2661/4 "2022-05-30T05:53:30Z")

</div>

@uashok93 How about incrementing from 1? This function is all about just the unique id right? & How about number of characters?

---

<div class="post-metadata">

**Author:** ![uashok93](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/uashok93/32/3959_2.png) [@uashok93](https://forums.pega.com/u/uashok93)\
**Post date:** [May 30, 2022, 12:10pm UTC](https://forums.pega.com/t/generating-unique-id-with-prefix/2661/5 "2022-05-30T12:10:44Z")

</div>

@AkshithReddyT Give it a try Akshith , if Prefix is “A” it goes like A-1, A-2, A-3,A-4 ,A-5 …

---

<div class="post-metadata">

**Author:** ![MayankVerma](https://avatars.discourse-cdn.com/v4/letter/m/0ea827/32.png) [@MayankVerma](https://forums.pega.com/u/MayankVerma)\
**Post date:** [May 30, 2022, 6:19pm UTC](https://forums.pega.com/t/generating-unique-id-with-prefix/2661/6 "2022-05-30T18:19:01Z")

</div>

@SaiG5925 Case ID generation has been changed since Pega v8.3. You can find detail here - [https://collaborate.pega.com/discussion/case-id-generation-mechanism](https://collaborate.pega.com/discussion/case-id-generation-mechanism)

In short, follow the below steps:

1. Create a DSS idGenerator/ID-/batchSize with value as 1.

2. Restart the server.

3. Use Work.GenerateID activity and pass the prefix as ID-.

---

<div class="post-metadata">

**Author:** ![Sai\_Guggilla](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/sai_guggilla/32/11575_2.png) [@Sai\_Guggilla](https://forums.pega.com/u/Sai_Guggilla)\
**Post date:** [June 1, 2022, 6:21am UTC](https://forums.pega.com/t/generating-unique-id-with-prefix/2661/7 "2022-06-01T06:21:51Z")

</div>

@uashok93 this function is working
