# "Bulk Add Queue Items" and "Unique Reference" Queue

**URL:** <https://forum.uipath.com/t/bulk-add-queue-items-and-unique-reference-queue/154187>\
**Category:** Activities\
**Tags:** completed, system, activities\
**Created:** [September 25, 2019, 8:51pm UTC](https://forum.uipath.com/t/bulk-add-queue-items-and-unique-reference-queue/154187 "2019-09-25T20:51:28Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![huangsuixi](https://avatars.discourse-cdn.com/v4/letter/h/f9ae1b/32.png) [@huangsuixi](https://forum.uipath.com/u/huangsuixi)\
**Post date:** [September 25, 2019, 8:51pm UTC](https://forum.uipath.com/t/bulk-add-queue-items-and-unique-reference-queue/154187/1 "2019-09-25T20:51:28Z")

</div>

“Buld Add Queue Items” activities currently cannot be used for unique reference queues (doing so seems to create an “Bad Request” error). Most likely multiple empty reference from the input datatable are causing unique conflicts.

Can we please exclude empty reference from the unique definition? Or better, add an additional input parameter for the “Buld Add Queue Items” to choose an “Index Column” which will be filling the reference field?

---

<div class="post-metadata">

**Author:** ![Pablito](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/pablito/32/385495_2.png) [@Pablito](https://forum.uipath.com/u/Pablito)\
**Post date:** [September 26, 2019, 6:49am UTC](https://forum.uipath.com/t/bulk-add-queue-items-and-unique-reference-queue/154187/2 "2019-09-26T06:49:17Z")

</div>

Hi @huangsuixi,  
Are you able to show potential example or use case?

---

<div class="post-metadata">

**Author:** ![huangsuixi](https://avatars.discourse-cdn.com/v4/letter/h/f9ae1b/32.png) [@huangsuixi](https://forum.uipath.com/u/huangsuixi)\
**Post date:** [September 26, 2019, 5:27pm UTC](https://forum.uipath.com/t/bulk-add-queue-items-and-unique-reference-queue/154187/3 "2019-09-26T17:27:14Z")

</div>

Thanks for getting back so fast.

**First I want to update my observations.**

When a queue has “Unique Reference” enabled, it seems like “Bulk Add Queue Items” activities simply won’t work even with single row datatable as input. It will either say “Bad Request” (if commit type is AllOrNothing) or “Unable to Add” (if commit type is “ProcessAllIndepently”). Similar response can be observed by manual upload through Orchestrator website:

![image](https://global.discourse-cdn.com/uipath/original/3X/2/8/28c1c6beb01533415d3d29e6b19ae072d4e0f468.png)

**Update Suggestion**

Add an index column (or a formula utilizing certain column value of the datatable) as input for “Bulk Add Queue Items” is first and foremost a way to ensure compatibility of these two features. Ideally, we should probably also add an option to change the behavior of “Unique Reference” to instead overwrite (or auto deletion) of the old item.

**Use Cases.**

Think about a routine case with following sequence:

1. Dispatcher A add queue items requesting updates on certain attributes of some entities; each such entity has its own unique ID.

2. Performer B process the queue at fixed time of day and send revelent users (linked to entity) confirmation emails.

Note that A can be triggered multiple times throughout the day, thus may target same entity. However, the content of such requests may be different. In case of a duplication, the earlier request should be voided.

Also note that B needs to be scalable, so queue items created in A must be decentralized.

**Solution:**

Due to the limitation mentioned earlier, my current solution requires me to use a combination of “Get Queue Items” (reference = entity ID) and “Delete Queue Items” prior to “Add Queue Item” in Dispatcher A. And I must loop through the input DataTable to create each Queue Item.

If the suggested updates can be implemented, all I need to do is to apply a “Bulk Add Queue Items” with “Unique Reference” set as overwrite.

---

<div class="post-metadata">

**Author:** ![Pablito](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/pablito/32/385495_2.png) [@Pablito](https://forum.uipath.com/u/Pablito)\
**Post date:** [September 27, 2019, 6:50am UTC](https://forum.uipath.com/t/bulk-add-queue-items-and-unique-reference-queue/154187/5 "2019-09-27T06:50:56Z")

</div>

Thank you for your suggestion. I added it to our internal ideas tracker for our team to consider.

---

<div class="post-metadata">

**Author:** ![huangsuixi](https://avatars.discourse-cdn.com/v4/letter/h/f9ae1b/32.png) [@huangsuixi](https://forum.uipath.com/u/huangsuixi)\
**Post date:** [September 27, 2019, 12:24pm UTC](https://forum.uipath.com/t/bulk-add-queue-items-and-unique-reference-queue/154187/6 "2019-09-27T12:24:24Z")

</div>

Thank you Pablito.

---

<div class="post-metadata">

**Author:** ![badita](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/badita/32/6_2.png) [@badita](https://forum.uipath.com/u/badita)\
**Post date:** [September 29, 2019, 7:52am UTC](https://forum.uipath.com/t/bulk-add-queue-items-and-unique-reference-queue/154187/7 "2019-09-29T07:52:07Z")

</div>

> [@huangsuixi](#):
>
> “Buld Add Queue Items” activities currently cannot be used for unique reference queues

If this is what’s happening we have a bug. @huangsuixi could you please upload a dummy CSV file for testing?

---

<div class="post-metadata">

**Author:** ![huangsuixi](https://avatars.discourse-cdn.com/v4/letter/h/f9ae1b/32.png) [@huangsuixi](https://forum.uipath.com/u/huangsuixi)\
**Post date:** [September 30, 2019, 12:37pm UTC](https://forum.uipath.com/t/bulk-add-queue-items-and-unique-reference-queue/154187/8 "2019-09-30T12:37:26Z")

</div>

Thanks Badita, I believe any CSV would trigger that error, as a reference is required for an unique reference queue, yet the current interface for Bulk add does not provide a way to provide that information.

Here is an basic example (sorry forum does not allow csv upload, so I just screenshot it):

Prior to upload:  
 ![image](https://global.discourse-cdn.com/uipath/original/3X/e/e/ee4df32b75e97cee611a1d8411ad22242e583a5a.png)

After clicking upload:  
 ![image](https://global.discourse-cdn.com/uipath/original/3X/1/4/140f9434ecfb2ed97cc98e45045ae99d200b416a.png)

---

<div class="post-metadata">

**Author:** ![badita](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/badita/32/6_2.png) [@badita](https://forum.uipath.com/u/badita)\
**Post date:** [September 30, 2019, 12:43pm UTC](https://forum.uipath.com/t/bulk-add-queue-items-and-unique-reference-queue/154187/9 "2019-09-30T12:43:03Z")

</div>

What happens if you add a **Reference** column and put some unique ids into?

---

<div class="post-metadata">

**Author:** ![huangsuixi](https://avatars.discourse-cdn.com/v4/letter/h/f9ae1b/32.png) [@huangsuixi](https://forum.uipath.com/u/huangsuixi)\
**Post date:** [September 30, 2019, 3:08pm UTC](https://forum.uipath.com/t/bulk-add-queue-items-and-unique-reference-queue/154187/10 "2019-09-30T15:08:53Z")

</div>

Ah you are right - adding a “Reference” column fixed that. I cannot believe I have not thought of that. ☹

That is good news indeed, as I can simply append a “Reference” column to the datatable prior to adding to queue. Thanks a lot.

Please close the topic.

---

<div class="post-metadata">

**Author:** ![badita](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/badita/32/6_2.png) [@badita](https://forum.uipath.com/u/badita)\
**Post date:** [September 30, 2019, 3:27pm UTC](https://forum.uipath.com/t/bulk-add-queue-items-and-unique-reference-queue/154187/11 "2019-09-30T15:27:27Z")

</div>

> **[About Queues and Transactions](https://docs.uipath.com/orchestrator/docs/about-queues-and-transactions#section-column-mapping)**
>
> A queue is a container that enables you to hold an unlimited number of items. Queue items can store multiple types of data, such as invoice information or customer details. This information can be processed in other systems - SAP or Salesforce, for...

---

<div class="post-metadata">

**Author:** ![huangsuixi](https://avatars.discourse-cdn.com/v4/letter/h/f9ae1b/32.png) [@huangsuixi](https://forum.uipath.com/u/huangsuixi)\
**Post date:** [September 30, 2019, 5:43pm UTC](https://forum.uipath.com/t/bulk-add-queue-items-and-unique-reference-queue/154187/12 "2019-09-30T17:43:24Z")

</div>

Thanks, it is very well documented here. Not sure how I missed that. Will be more thorough next time.
