How to convert xlsx column data into array in uipath?

Based on the image below , I wanna to convert all the data in the column to array. Any idea? guys ?

ddd

You can do it in a for each loop (i’d recommend a list instead of an array if using this approach), or you could use linq. The linq approach still uses a for each loop, it just does so internally in the calculation

EDIT: Here are examples in pseudocode for both ways:

FOR EACH METHOD
Assign MyList = new list(of string)
For each row in dt1
add to collection activity:
collection = MyList
datatype = string
value = row.item("Subject").ToString

LINQ METHOD
Assign MyArray = dt1.AsEnumerable().Select(Function(x) x.Field(Of String)("Subject")).ToArray()

1 Like

You should start by using the activity Read Column.

2 Likes

@Jelrey you should just do what @bcorrea mentioned. I’m guessing it does the same thing I mentioned, but all contained in one simple activity and it does exactly what you’re asking

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