Extract all contents from a queue item and save it in a text file

Hello All,

Uipath Example.txt (700 Bytes)

I uploaded this file data to the orchestrator queue and it got uploaded successfully. Now I am trying to use get transaction data activity and save all contents of that queue item in a text file and store that file to a location.

How will I store all contents of a queue item in a file?
I also want to extract ‘name’ and ‘uplod_type’ from the queue item and store in variables. They are under “submission_files”

Please do help.

Thanks in advance!

Hi,

If you want to get any specific item from the queue item, once you store the retrieve queue item object into a variable, you can call .SpecificContent(“<attribute_name”>) which you want to retrieve.

It seems to me that you have uploaded the file in form a JSON string in the queue. If so, follow the below steps:

For example, if my variable for QueueItem would have been named as QueueItemTest, in order to retrieve the submission files first, I would use an assign activity to get the JSON string as:

QueueItemTest.SpecificContent(“submission_files”).ToString

Once, I have the JSON string with me I can deserialize the JSON string using the “Deserialize Json” activity to store it into some variable let say JObjTest of JObject type.

Then you can easily call JObjTest.Item(“upload_type”).ToString or JObjTest.Item(“name”).ToString to get any specific value inside that JSON.

1 Like

no. I didn’t get you.

I have basically 2 requirements
1st is – I am getting the input for my queue in JSON format from the one another system. The input will not be in the static format. I used get transaction item activity and received the transaction item. Now I want to store all the content of that transaction item in a text file and store that file at the particular location. How will I store all the contents (Everything… key and values…) of the transaction item in a text file ?

2nd is – I want to extract only the name of the file and used specificContent but it throws me an error. Please check the screenshot.

Hi,

If you want to store all the contents of the queue item in a key value pair kind of a format, You can use a for Each Loop and assign a variable called item with the Argument Type as KeyValuePair<String, Object> and iterate over In_TransactionItem.SpecificContent

Inside the for each you can access each key as item.Key and each value as item.Value which you can store in a text file in any format you wish. For example: Use Write File activity and use item.Key+“–>”+item.Value

1 Like

how will I know keys ?? the content in transaction item is not going to be static ?
can you give an simple example please ?

I passed header key and received all the data.

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