How to read column names from queue Item

Each transaction Have 3 different columns, How do I read those,

In_TransactionItem.SpecificContent(“Column1”).ToString

In_TransactionItem.SpecificContent(“Column2”).ToString

In_TransactionItem.SpecificContent(“Column3”).ToString

Thanks In advance.

@uipath @Anil_G @Yoichi @supermanPunch @Gokul001 @Gokul_Jayakumar

@ManjunathReddy

What is the transaction type is it datarow?

if yes then try this In_TransactionItem(“Column2”).ToString

Cheers

The transactionItem Is QueueItem.

out_TransactionItem.SpecificContent.Keys
will give you The queue Keys

Hi @ManjunathReddy

Then use this below syntax:

In_TransactionItem.SpecificContent(“Column1”).ToString

Hope it helps !!
Regards

@ManjunathReddy

If its queue item then you already gave the syntax…and in queue you will have keys and not columns

cheers

Thank you for repley

@Vikas_M I need Syntax

@Anil_G Yes I am able read the values, but i required column name of it.

@Parvathy

If queueItem IsNot Nothing AndAlso queueItem.SpecificContent IsNot Nothing
columnNames = queueItem.SpecificContent.Keys.ToList()
Else
columnNames = New List(Of String) // Handle the case where SpecificContent is null or empty
End If

So this will give you a list of Column names(Its called keys btw).
Just use that list accordingly

@Vikas_M

Can’t we write in single line syntax.

Thanks for the solution

@uipath

@ManjunathReddy

This will give all the keys…and as it is queue item you need not check for empty

cheers

@ManjunathReddy
No , if u want to write it in single line then u have to write multiline LINQ which makes the process complex

So better convert it into list as i have shown and then use a loop to iterate through them

I hope it helps you, If it helped you Please mark it as solution it will motivate me to solve more questions

Yes , If he is using Get transaction item activity then Once the queue is empty It gives output as “No Transaction Data”

1 Like

@Vikas_M

As per syntax anyways he is using RE so ideally no need to check is what I meant :slight_smile:

cheers

1 Like

Yea i used that to be on safer side , But yea you are right!
Thanks for that mate!

1 Like

@Vikas_M how to print Keys and values from it .

image

@Anil_G @Yoichi

@ManjunathReddy

if you have a queueitem type then queuitemvar.SpecificContent.Keys and queuitemvar.SpecificContent.Values

cheers

Hey @ManjunathReddy
To get keys and values, below is the code
To get keys : in_TransactionItem.SpecificContent.Keys
To get values: in_TransactionItem.SpecificContent.Values

Hope it helps you

@Vikas_M

Showing below error.

@Anil_G

@ManjunathReddy

First that is not error

If you want to disply…

Then use String.Join(",",in_TransactionItem.specificContent.Keys.ToList)

Cheers

@ManjunathReddy
You can try below code to get first key and value of transaction item

(TransactionItem.specificContent.Keys(0)).Tostring

(TransactionItem.specificContent.Values(0)).Tostring

So this will basically give you the first key and first value of the current transaction item

Also Refer below thread it will be helpful