How to convert DataTable to IEnumerable

datatable
for

#1

I was just wondering. If DataTable is an object is there a way to use it in ForEach control flow as a sort of collection?
And if yes, how do I convert DataTable to such iterable object?

Many thanks,


#2

Hello @Klim

You can use For Each Row Activity or For Each Activity changing TypeArgument property:

https://www.uipath.com/activities-guide/for-each-row

Regards,
Susana


#4

Hi Susana,
thanks for your response! yes, I know about For Each Row and it works with an object DataTable just fine. But I was wondering is there a chance to convert a DataTable into enumerable / iterator object? just a technical question.

Thanks!


#5

Hi @Klim,

Take a look at this:

Regards


#6

Thanks @Susana! appreciate your response! it was very helpful.