# How to read Queue reference?

**URL:** <https://forum.uipath.com/t/how-to-read-queue-reference/696216>\
**Category:** Activities\
**Tags:** activities-panel, question, studio, system, activities\
**Created:** [November 14, 2023, 10:05am UTC](https://forum.uipath.com/t/how-to-read-queue-reference/696216 "2023-11-14T10:05:29Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![ManjunathReddy](https://avatars.discourse-cdn.com/v4/letter/m/a6a055/32.png) [@ManjunathReddy](https://forum.uipath.com/u/ManjunathReddy)\
**Post date:** [November 14, 2023, 10:05am UTC](https://forum.uipath.com/t/how-to-read-queue-reference/696216/1 "2023-11-14T10:05:29Z")

</div>

I have queue reference like below, Based on the environment I have to move that particular sequence.

Let me know how to do with Queue reference

1234\_Facebook\_PROD  
5678\_Facebook\_UAT  
9123\_Facebook\_SIT

Thanks in Advance.

---

<div class="post-metadata">

**Author:** ![AJ\_Ask](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/aj_ask/32/555384_2.png) [@AJ\_Ask](https://forum.uipath.com/u/AJ_Ask)\
**Post date:** [November 14, 2023, 10:15am UTC](https://forum.uipath.com/t/how-to-read-queue-reference/696216/2 "2023-11-14T10:15:38Z")

</div>

Hi @ManjunathReddy

You can use the “Get Transaction Item” activity to retrieve an item from a queue, the output variable (`transactionItem` ) contains information about the retrieved queue item. `transactionItem.Reference` can be used to access the reference of the queue item as a string.

If you get the queue reference & assign it to a variable you can use else if condition like this to run different flows

> QueueName.Contains(“\_PROD”)

 ![image](https://global.discourse-cdn.com/uipath/original/4X/1/3/7/137a2adaac55410e3a1b37e57fa446d4c034f627.png)

Hope this helps 🙂

---

<div class="post-metadata">

**Author:** ![ManjunathReddy](https://avatars.discourse-cdn.com/v4/letter/m/a6a055/32.png) [@ManjunathReddy](https://forum.uipath.com/u/ManjunathReddy)\
**Post date:** [November 14, 2023, 10:23am UTC](https://forum.uipath.com/t/how-to-read-queue-reference/696216/3 "2023-11-14T10:23:29Z")

</div>

I want read queue reference.

---

<div class="post-metadata">

**Author:** ![AJ\_Ask](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/aj_ask/32/555384_2.png) [@AJ\_Ask](https://forum.uipath.com/u/AJ_Ask)\
**Post date:** [November 14, 2023, 10:33am UTC](https://forum.uipath.com/t/how-to-read-queue-reference/696216/4 "2023-11-14T10:33:16Z")

</div>

Use the get transaction item activity. Select the right Folder path & Queue name then assign Output to TransactionItem variable then to read the Queue reference you can use

> TransactionItem.Reference

 ![image](https://global.discourse-cdn.com/uipath/original/4X/f/c/e/fceff8253c0fcc22e9caea7ca6e0b92d5471b613.png)

---

<div class="post-metadata">

**Author:** ![Gokul\_Jayakumar](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/gokul_jayakumar/32/425938_2.png) [@Gokul\_Jayakumar](https://forum.uipath.com/u/Gokul_Jayakumar)\
**Post date:** [November 14, 2023, 10:44am UTC](https://forum.uipath.com/t/how-to-read-queue-reference/696216/5 "2023-11-14T10:44:27Z")

</div>

Hello @ManjunathReddy , Try This

```auto
TransactionItem.Reference -----> Reference of the specific queue will be printed here

```

Using If Condition you can separate the Queue based on Queue reference.

```auto
TransactionItem.Reference.ToLower.Trim.Contains(facebook_prod)

TransactionItem.Reference.ToLower.Trim.Contains(facebook_uat)

TransactionItem.Reference.ToLower.Trim.Contains(facebook_sit) 

```

---

<div class="post-metadata">

**Author:** ![sanjay3](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/sanjay3/32/365624_2.png) [@sanjay3](https://forum.uipath.com/u/sanjay3)\
**Post date:** [November 14, 2023, 10:44am UTC](https://forum.uipath.com/t/how-to-read-queue-reference/696216/6 "2023-11-14T10:44:28Z")

</div>

Hi @ManjunathReddy

Use Get Transaction Item activity (Output=TransactionItem)

Use Assign Activity  
QueueRefrence= TransactionItem.Reference.ToString

For the further use

To extract the last word before underscore , you can split the string by underscores and take the last part.  
LastWord = queueReference.Split("\_"c).Last()

Switch activity on LastWord variable

Case “PROD”:  
// Sequence for Production environment

Case “UAT”:  
// Sequence for UAT environment

Case “SIT”:  
// Sequence for SIT environment

Default:  
// Sequence if environment is none of the above or not recognized

Hope this helps

---

<div class="post-metadata">

**Author:** ![ManjunathReddy](https://avatars.discourse-cdn.com/v4/letter/m/a6a055/32.png) [@ManjunathReddy](https://forum.uipath.com/u/ManjunathReddy)\
**Post date:** [November 14, 2023, 11:17am UTC](https://forum.uipath.com/t/how-to-read-queue-reference/696216/7 "2023-11-14T11:17:10Z")

</div>

Flow switch also works right?

---

<div class="post-metadata">

**Author:** ![sanjay3](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/sanjay3/32/365624_2.png) [@sanjay3](https://forum.uipath.com/u/sanjay3)\
**Post date:** [November 14, 2023, 11:31am UTC](https://forum.uipath.com/t/how-to-read-queue-reference/696216/8 "2023-11-14T11:31:13Z")

</div>

Hi @ManjunathReddy

Yes it will

---

<div class="post-metadata">

**Author:** ![Yogeesh\_G](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/yogeesh_g/32/186238_2.png) [@Yogeesh\_G](https://forum.uipath.com/u/Yogeesh_G)\
**Post date:** [November 15, 2023, 3:39am UTC](https://forum.uipath.com/t/how-to-read-queue-reference/696216/9 "2023-11-15T03:39:53Z")

</div>

Hi @ManjunathReddy

1. Get Transaction Item (Get Transaction Item from Orchestrator)

2. Assign Activity:

3. Switch Activity:

Thank you

---

<div class="post-metadata">

**Author:** ![Anil\_G](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/anil_g/32/524291_2.png) [@Anil\_G](https://forum.uipath.com/u/Anil_G)\
**Post date:** [November 15, 2023, 4:14am UTC](https://forum.uipath.com/t/how-to-read-queue-reference/696216/10 "2023-11-15T04:14:56Z")

</div>

@ManjunathReddy

You can simply use a switch activity

And give this in expression `TransactionItem.Reference.Split("_"c)(2)`

And PROD,UAT and SIT as 3 cases

Cheers

---

<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:** [November 18, 2023, 4:15am UTC](https://forum.uipath.com/t/how-to-read-queue-reference/696216/11 "2023-11-18T04:15:52Z")

</div>

Closed on November 18, 2023, 4:15am UTC

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