Using list values in a "add data row "activity

Hello
I have a data table that i need to fill with a list values .
Is it possible?
thank you

@Dhouha_Cherif
welcome to the forum

Lets assume the datatable has only 1 column - dtResult and is initialized correctly (e.g. done with build datatable)

Give a try on:

Use an assign activity:
Left side: dtResult
Right side:
(From x in YourListVar
Let ra = new Object(){x}
Select dtResult.Rows.Add(ra)).CopyToDataTable

it will add for each item a datarow

In case of the list should be the value for a datacolumn in one row, then it is to configure on the datatype setting of the datacolumn properties

Maybe you can share with us some more details on List, DataColumn Structure. Thanks

thank you for your help
my data table is already filled with other items
how can i specify in whitch column the list items will be added?

thanks, some samples would be helpfully so we adress your case more individually

The list contains a 3 Strings.
The data table contains 3 columns , the first and second columns are filled with strings (name, last name) the third one should contain the 3 strings of the list.
The data table will be stored in a csv file as it’s shown below .
image

String join could help
grafik

Working with a datatable we use:

  • Add data row - in case of the row in not present in the datatable
    grafik

  • In case of a row with Sally Woodson is already present then update the row like

    • Assign Activity: YourDataRowVar(“ColumnNameOrIndex”) = String.Join(",",ListFriends)

Is yours list containing only those three values and for each cell in that column you will have another list? Because you can try to use string.join to concatenate those values in that list to fill that cell

thank you so much it worked

thank you so much
it worked with the sting.join

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