# Queue unique reference

**URL:** <https://forum.uipath.com/t/queue-unique-reference/717428>\
**Category:** Studio\
**Tags:** question, orchestrator, system, activities\
**Created:** [February 5, 2024, 5:01pm UTC](https://forum.uipath.com/t/queue-unique-reference/717428 "2024-02-05T17:01:47Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![A\_Learner](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/a_learner/32/181354_2.png) [@A\_Learner](https://forum.uipath.com/u/A_Learner)\
**Post date:** [February 5, 2024, 5:01pm UTC](https://forum.uipath.com/t/queue-unique-reference/717428/1 "2024-02-05T17:01:47Z")

</div>

Hi,  
When I am trying to add a queue item with unique reference set, if it is added for the second time, the bot is throwing an error, How to work with this error in REFRanework. I only want the bot to add new items to quuee and ignore already added items,

Thank you,

---

<div class="post-metadata">

**Author:** ![mkankatala](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/mkankatala/32/484097_2.png) [@mkankatala](https://forum.uipath.com/u/mkankatala)\
**Post date:** [February 5, 2024, 5:14pm UTC](https://forum.uipath.com/t/queue-unique-reference/717428/2 "2024-02-05T17:14:10Z")

</div>

Hi @A_Learner

Could you please share the error here what you are exactly getting.

---

<div class="post-metadata">

**Author:** ![A\_Learner](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/a_learner/32/181354_2.png) [@A\_Learner](https://forum.uipath.com/u/A_Learner)\
**Post date:** [February 5, 2024, 5:20pm UTC](https://forum.uipath.com/t/queue-unique-reference/717428/3 "2024-02-05T17:20:31Z")

</div>

Add Queue Item: Error creating transaction. Duplicate reference error code:1016

---

<div class="post-metadata">

**Author:** ![rikulsilva](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/rikulsilva/32/462189_2.png) [@rikulsilva](https://forum.uipath.com/u/rikulsilva)\
**Post date:** [February 5, 2024, 5:24pm UTC](https://forum.uipath.com/t/queue-unique-reference/717428/4 "2024-02-05T17:24:35Z")

</div>

Hi @A_Learner

The bot will receive the error code 1016 (DuplicateReference). So you can surround the Add Queue Item activity with Try Catch then treat the error code in Exception, ignoring the error, reponse to source system about the duplicate etc

Orchestrator response codes

> **[Orchestrator - Response Codes](https://docs.uipath.com/orchestrator/automation-cloud/latest/api-guide/response-codes)**
>
> The UiPath Documentation Portal - the home of all our valuable information. Find here everything you need to guide you in your automation journey in the UiPath ecosystem, from complex installation guides to quick tutorials, to practical business...

Cheers

Henrique Lima

---

<div class="post-metadata">

**Author:** ![efelantti](https://avatars.discourse-cdn.com/v4/letter/e/9fc29f/32.png) [@efelantti](https://forum.uipath.com/u/efelantti)\
**Post date:** [February 5, 2024, 5:25pm UTC](https://forum.uipath.com/t/queue-unique-reference/717428/5 "2024-02-05T17:25:53Z")

</div>

Another solution - you could use the “Get Queue Items” activity to check for existing items with the reference. Only if the result is 0, proceed with adding to queue.

---

<div class="post-metadata">

**Author:** ![A\_Learner](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/a_learner/32/181354_2.png) [@A\_Learner](https://forum.uipath.com/u/A_Learner)\
**Post date:** [February 5, 2024, 5:27pm UTC](https://forum.uipath.com/t/queue-unique-reference/717428/6 "2024-02-05T17:27:21Z")

</div>

Thank you, @efelantti  
Can you put the code segment here?

Thank you,

---

<div class="post-metadata">

**Author:** ![mkankatala](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/mkankatala/32/484097_2.png) [@mkankatala](https://forum.uipath.com/u/mkankatala)\
**Post date:** [February 5, 2024, 5:31pm UTC](https://forum.uipath.com/t/queue-unique-reference/717428/7 "2024-02-05T17:31:27Z")

</div>

While you are creating the queue in Orchestrator. If you checked the Enforce Unique reference option then it will not allow you to add duplicate reference queues into it.

Uncheck the option and then try it will add the queues with same reference for sure.

Check the below image for better understanding,

 ![image](https://global.discourse-cdn.com/uipath/original/4X/2/4/7/247433e70da3fd2672ac11e67d5cc663bd12bc3b.png)

Hope you understand!!

---

<div class="post-metadata">

**Author:** ![rikulsilva](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/rikulsilva/32/462189_2.png) [@rikulsilva](https://forum.uipath.com/u/rikulsilva)\
**Post date:** [February 5, 2024, 6:02pm UTC](https://forum.uipath.com/t/queue-unique-reference/717428/8 "2024-02-05T18:02:41Z")

</div>

Hi @A_Learner

The attached workflow contains both strategies

[DuplicateReference.zip](https://forum.uipath.com/uploads/short-url/mAkev4F0qNUlsbWXe7NQU680YnI.zip) (4.7 KB)

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/system/32/182466_2.png) [@system](https://forum.uipath.com/u/system)\
**Post date:** [February 8, 2024, 6:03pm UTC](https://forum.uipath.com/t/queue-unique-reference/717428/9 "2024-02-08T18:03:02Z")

</div>

Closed on February 8, 2024, 6:03pm UTC

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.
