All about Datatable - UiPath

Thanks sir

Thank you @Palaniyappan!

I need to brush up my DataTable skills so this is awesome :+1:

2 Likes

That’s awesome bro! :slight_smile:

1 Like

Thank you for this useful information all in one place!

2 Likes

Hi @Palaniyappan , Good one. I would like to get your thoughts on the below:
I have a datatable dt, with 20 rows and 5 columns.
Two of the columns are ID NUMBER and STATUS.
Column ID NUMBER and STATUS can have duplicate values. I am applying necessary filter on this and then iterating each row by row.
So out of 20 , after filtering I got 10. Bot need to process only 10.

How can I get the cell name/index of each transactions? I tried the indexof activity but it will return always as 0,1,2 etc where as I am looking for something like 5,7,9 11, etc, it will be completely random after filtering.

From the image below, bot will be applying filter on ID column for “def” and Status column “Done”. What I need result is 6 and 7 (their respective index after filtering)

Feel free to let me know if you need anything else from my side.

Thanks for making my life easy. :grinning:

I get an error in UiPath Studio 2021.10 that says “Compiler Error(s)… ‘Top’ is not a member of System.Data.EnumerableRowColection…”
should the method be Take(5) ?

1 Like

@John.Doyle.KBX
Yes, it is about the Take Operator

Hi,

I tried to use the sulotion 7. Remove duplicate records in one column

Use a assign activity like this

dt= dt.AsEnumerable().GroupBy(Function(i) i.Field(Of String)("Columnwithduplicatevalues")).Select(Function(g) g.First).CopyToDataTable

But getting error message that “GroupBy” is not a member of ‘EnumberableRowCollection(Of DataRow)’
image
Would you please advise how to achieve to remove duplicate row based on one column? Thanks.