Way to change System.Collections.Generic.IList<> to the Data Table

I am doing Query the data records from the data service(uipath) and paste those records in the excel.

1.Querydata , data type is IList<>
2.CreateDataTable
3.Assign those IList<> in the for each.
4.add datarow
5.make output datatable

I dont know how to assign in Step3.

Thanks in advance
Sincerely

what inside the List is here.
List(1) { OrderReceived { Company=β€œAAA”,
CreatedBy=SystemUser { CreateTime=[03/08/2021 06:23:09 +00:00]
, Id=[2addfc8f-de5a-4d21-b261-d159bc609e8f], IsActive=true, Name="…", Type=User, UpdateTime=[03/08/2021 06:23:09 +00:00] }, CreateTime=[10/25/2021 09:33:42 +00:00], DelieveryDate=[10/21/2020 00:00:00], Id=[efea2da4-7635-ec11-981f-dc98402f8053], InCharge=β€œe”, OrderDate=[12/13/2021 00:00:00], OrderNO=β€œ1”, ProductName=β€œet”, Quantity=β€œ1”, Total=β€œ133”, Unit=β€œ133”, UpdatedBy=SystemUser { CreateTime=[03/08/2021 06:23:09 +00:00], Id=[2addfc8f-de5a-4d21-b261-d159bc609e8f], IsActive=true, Name="…", Type=User, UpdateTime=[03/08/2021 06:23:09 +00:00] }, UpdateTime=[10/25/2021 09:33:42 +00:00] } }

I assign this , but got the wrong answer. It should get β€œAAA” not β€œD”.
The result of query records may be one or more records
Thanks you again

depending on that all bold marked properties are all columns from the databal you can start with following:

assign Activity
RowArrayList | List(Of Object) =

(From x in OutputRecords
let c = x.Company
let d = x.DeliveryDate
let p = x.ProductName
let q = x.Qantity
Let t = x.Total
Let u = x.Unit
Let ra = new Object(){c,d,p,q,t,u}
Select a=ra).toList

wthin a for each you can interate over RowArrayList | item in RowArrayList
and can use item within an add datarow for the RowArray

1 Like

Thank you so much for the reply @ppr

For my lack of understanding , i do not get the point.
Yes,Only the bold marked data(Company,Total… from the IList)
would be paste in the excel sheet.

Where do i assign this?
RowArrayList | List(Of Object) =
DataServiceJuchushitsuryoku.zip (15.9 KB)

@eimon
as an alternate

Set typeArgument to OrderReceived
grafik
e.g. Company
Complete your assign activity by:
CompanyName = item.Company

1 Like

Hello Mr.Peter@ppr
Thank you so much.
The problem was solved with your help.
I can eat dinner finally :robot:
Sincerely and have a good day

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