cancel
Showing results for 
Search instead for 
Did you mean: 

I have a scenario where I need to create a unique incrementing ID for each item loaded to WQ

I have a scenario where I need to create a unique incrementing ID for each item loaded to WQ. I can use GUID but I need something 6/7 digit number that can keep incrementing one by one and easy to read and recognize by busienss users.
For e.g. 300001, 300002, etc for each consecutive item.

Now when the blue prism stops the current session it won't have this stored data in any data item. And the process can run once a day and sometimes even after a week. So when I run it next week it should assign the next consecutive number such as 30003.

How this can be achieved in blueprism.

I thought about saving this ID in excel and store it but if there is any better way to achieve this please let me know.

------------------------------
Thanks & Regards,
Tejaskumar Darji
Sr. RPA Consultant-Automation Developer
------------------------------
1 BEST ANSWER

Helpful Answers

Use another queue. Create a single item, tag it with your process name. Use this item to store your last unique ID used. 
Get next item during initialisation of process filtered with the tag (so you can use the same queue for another process who needs the same mecanism). 
Use the data to populate your main process queue. At the end of the populate action, save the last item id in the single item and release it. 

br

------------------------------
philippe boutry
Blueprism Solution designer
Aubay
Europe/Paris
------------------------------

View answer in original post

7 REPLIES 7

mkumar407
Level 7
hi Tejas,

Excel is good option and can be used to set initial value whenever process triggers. 
Also, if schedule is not fixed can play with session variables to set initial value.

Also, may sound weird option but can use - Credentials and it's various options to get/set/save latest value of unique incrementing ID.




------------------------------
Manish Kumar
------------------------------

EmersonF
MVP
Hi @Tejaskumar_Darji.
There are several approaches, excel is valid, but you can explore other options
1 Save a txt file with the name of the last id, you would only need to read the file convert to number and put +1.
2 Could save this in BD, and just give a select with order by DESC.
3 It could take the items in the queue (Completed, Exceptions and Pending) merge to unify them all in a collection and give a Sort By via collection manipulation.

Hope I helped 😄

------------------------------
Emerson Ferreira
Sr Business Analyst
Avanade Brasil
+55 (081) 98886-9544
If my answer helped you? Mark as useful!
------------------------------
Sr Cons at Avanade Brazil

But Excel and Notepad would create issues with multi bot architecture right. For example 2 machines trying to append a new unique number to the same file.

------------------------------
Thanks & Regards,
Tejaskumar Darji
Sr. RPA Consultant-Automation Developer
------------------------------

HarshitRawat
Level 8
I have a small question. is the file supposed to keep only one value inside it after the execution has complete- for ex- 3000?
or it would contain a series of numbers which would keep on incrementing - for ex- 3000 , 3001 , 3002?

------------------------------
Harshit Rawat
Senior RPA Consultant
------------------------------

@Tejaskumar_Darji

Got it, so I advise you to use the work queue itself, maybe you'll waste a few seconds for this, but it sure will be more accurate then you'll have this multi bot problem.
What I usually do:
I create two processes: A "Producer" where all the work queue logic will be and which will run only when it is necessary to populate items and a consumer process where it is not responsible for populating, only consuming the queue items that have already been populated, then you can prevent this competition problem, knowing that a single robot will validate and popular and the consumer will consume everything.

------------------------------
Emerson Ferreira
Sr Business Analyst
Avanade Brasil
+55 (081) 98886-9544
If my answer helped you? Mark as useful!
------------------------------
-------------------------------------------
Sr Cons at Avanade Brazil

Any option is fine till it serves the purpose of making no duplication or no number skipping.
I'm inclined more towards an alternative where no such separate file is used considering multi bot architecture.

------------------------------
Thanks & Regards,
Tejaskumar Darji
Sr. RPA Consultant-Automation Developer
------------------------------

Use another queue. Create a single item, tag it with your process name. Use this item to store your last unique ID used. 
Get next item during initialisation of process filtered with the tag (so you can use the same queue for another process who needs the same mecanism). 
Use the data to populate your main process queue. At the end of the populate action, save the last item id in the single item and release it. 

br

------------------------------
philippe boutry
Blueprism Solution designer
Aubay
Europe/Paris
------------------------------