How to read Queue reference?

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.

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”)

Hope this helps :slight_smile:

I want read queue reference.

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

Hello @ManjunathReddy , Try This

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

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

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

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

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

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

Flow switch also works right?

Hi @ManjunathReddy

Yes it will

Hi @ManjunathReddy

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

    • Output: transactionItem
  2. Assign Activity:

    • Input: environment = transactionItem.Reference.Split("_"c)(2).ToUpper()
  3. Switch Activity:

    • Expression: environment
    • Cases:
      • “PROD”:
        • Sequence for PROD environment
      • “UAT”:
        • Sequence for UAT environment
      • “SIT”:
        • Sequence for SIT environment

Thank you

@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

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