I created output DT using Build Data Table but when adding Add Data Row it add multiple times. Any alternativ approaches? Am New to UiPath tool, plz guide me on the same
build the output datatable within the structure a from above:
Give a try on following as it is a quick Prototype:
(From d In dtdata.AsEnumerable
Group d By k=d(“Specifics”).toString.Trim Into grp=Group
Let lk = grp.ToDictionary(Of String, Object)(Function (x) x(0).toString.Trim, Function (x) x(2))
Let ra = {“A”,“B”,“C”,“D”,“E”}.Select(Function (v) lk(v)).toArray
Let ra2 = ra.Prepend(k).toArray
Select dtOutput.Rows.Add(ra2)).CopyToDataTable
Maybe you want to bring some dynamics and robustness into the code. Therefore you can just split the groups into a list(of list(Of DataRow)) (outer list=Group, Inner list=GroupMembers)
(From d In dtdata.AsEnumerable
Group d By k=d(“Specifics”).toString.Trim Into grp=Group
Select grp.toList).toList
And process the groups within a for each. Within a nested process block the group memebrs can be processed
I would like to update that this structure is dynamic so giving it liek {a,b,c,d,e} inside the expression won’t always work in my casee… thats the issue… i want to do it dyamic.
pls provude some response if possible… thanks again for ur time sir…
sir if ur are free, can u plz provide a sample xaml file…?? it would be of great help!!! plz!! also i need the output i dt format… as shown in picc… @ppr
sorry for 2 many questions… am new to this field… but definitely willing to learn and do more hard work sir!!