Capture Column values as Array of String or List

Hi

I am looking for a solution to capture column values into a collection such as array of string or a list using a single ‘Assign’ activity.

Datatable looks like this:
image

I want to use a single ‘Assign’ activity to capture all values from the column “Customer” into a collection:
List
Array of string
or String variable like this: 6001,6002,6003,6004,6005

Bonus points if you can skip any null values see orange cell:
image

Any alternative suggestions are welcome.

Cheers

Steve

Hi,

How about the following sample?

arrStr = dt.AsEnumerable.Select(Function(r) r("Customer").ToString).Where(Function(s) not String.IsNullOrEmpty(s)).ToArray()

Sample
Sample20230411-2.zip (8.6 KB)

Regards,

1 Like

Thanks @Yoichi - works exactly as requested.

All points awarded.

Cheers

Steve

1 Like

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