Convert data column to string


I am having a datatable with two columns in string format. It can have any random data as below.

|Mercury | Venus|
|Neptune | Mars |

My flow will receive an int parameter and I have to concatenate those many rows of column 2.

Example1 : If flow receives 2 as parameter, then output would be “Venus,Mars”
Example2: If flow receives 4 as parameter, then output would be “Venus,Mars,Saturn,Earth”

It can be done using For loop, but wanted to check if there can be a better way of doing it(using linq?).

@Kapil Considering the Source Data is Column2, You can use Take method to take the number of rows as you need. Similar Linq Query is Given Below :


Where DT is your Datatable variable and intParameter is the parameter that decides the number of values to be taken.

Thanks!! It worked

1 Like

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