Storing queue items in a DataTable... Armazenar os itens de uma fila em um DataTable

I’m trying to store the items from a queue into a DataTable. The activity I’ve attempted so far is the Orchestrator HTTP Request. I’m open to any ideas, but so far, I’ve had no success. The goal is to preferably retrieve items marked as “success.”

pt-br
Estou tentando armazenar os itens de uma fila em uma Datatable. A atividade que tentei até agora foi o Orchestrator HTTP Request. Estou aberto a qualquer ideia, mas até o momento sigo sem sucesso. A ideia é trazer preferencialmente os itens com “sucesso”

here we would recommend to be more specific at which all data / properties are to store within the datatable

  • Only SpecificContent Data
  • with / without specific properties from the queue items

we would use a filter to the status

Use the Get Queue Items activity and filter on status.

Built Data Table to prepare for the data.

Loop through the IEnumerable it gives you, and use Add Data Row to add each item to the datatable.

From each sucess item i need the keys like:

cod_emp: colun 1
Filial: colun 2
.
etc

image

I tried i dont know how to convert the IEnumerable as the image bellow

when working with

  • Deserialize JSON Activity - out: myJObject
  • Assign activity:
    dtData | DataTable =
Newtonsoft.Json.Linq.JArray.FromObject(myJObject("value").Select(Function (x) x("SpecificContent").ToObject(Of DataTable)

OR
we loop and populate defensive a datatable

OR
as mentioned by Paul using Get Queue Items activity and populate defensive a datatable

Also have a look here:

You use the Array Row property and reference the IEnumerable.

image

{currentItem.SpecificContent(“Customer Name”).ToString,currentItem.SpecificContent(“Customer ID”).ToString}

Could you please show me your actvityes propertie?


And for the Add data row :

That’s my error:
Argumento “DataRow”: BC30456: ‘SpecificContent’ is not a member of ‘DataTable()’.
Argumento “DataRow”: BC30456: ‘SpecificContent’ is not a member of ‘DataTable()’.
Argumento “DataRow”: BC36914: Cannot infer an element type, and Option Strict On does not allow ‘Object’ to be assumed. Specifying the type of the array might correct this error.

You don’t loop through the datatable. You loop through the variable in your Get Queue Items output. That variable is IEnumerable(of QueueItem) so the properties of currentItem are the same as they would be for a queue item (ie you can use .SpecificContent)

My output in Get Queu Items is “qItem”, as you can see in the screenshot i’m using it in “List of Items” on the loop.


In Add Data Row i’m using:
ArrayRow: currentItem.SpecificContent(“Cnpj”).ToString

the error is: Argumento “DataRow”: BC30311: Value of type ‘String’ cannot be converted to ‘DataRow’. O valor selecionado é incompatível com o tipo de propriedade.

in For each Argument Type i use UiPath.Core.QueuItem

LinhaDados (Array Row) requires an array, not a single value. You are giving it a single value. An Array is a list of values with { and } around it, separated by commas:

{“Value1”,“Value2”,“Value3”} or of course you can use variables {Var1,Var2,Var3}. As you can see from my original reply:

{currentItem.SpecificContent(“Customer Name”).ToString,currentItem.SpecificContent(“Customer ID”).ToString}

And the number of items in that array has to match the number of columns in your datatable dt_Emp as defined by the Build Data Table activity (which I didn’t show).

@postwick i was not using the activity build data Table

but now i have two colluns , but still have the problem.

Now i have a array and the error is:

Argumento “DataRow”: BC30311: Value of type ‘String()’ cannot be converted to ‘DataRow’. O valor selecionado é incompatível com o tipo de propriedade.

keep in mind that in the different localizations the settings can have different positions.

Instead of LinhaDados use LinhaMatrix like
new Object(){colVal1, colVal2…}

1 Like

Hello @ppr, thank you! It was just a linguistic problem. Now the @postwick tip worked!! Thank you so much, guys!

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