Add string array into data table column

I have an array of string and I want to add this array in data table column. I saw this link but couldn’t solve my issue. I also followed this link but Now I’m seeing System.String as value.
Following is my flow
4

This is my Datatable
1

This is what I’m giving in Add Data Row
2

And this is my result
3

Kindly guide me on this. Really appreciate your help :slight_smile:

2 Likes

Hi
Kindly change the type of column to string from string[ ] in BUILD DATATABLE activity and try once

Cheers @Maryum

@Palaniyappan Data type is already string
5

1 Like

thats what buddy change that to STRING
@Maryum

1 Like

@Palaniyappan I’ve changed the type as below 6
but still getting this output
3

1 Like

@Palaniyappan I Can’t understand what’s the issue.

1 Like

Fine
what is the type of imagelist variable
is it a string array if so then mention as imagelist directly and not like within curly braces {imagelist}

and how many element does it have
if it has only one element then its fine because we got only one column in our datatable
and if its more than one value in that array variable, then we need the same equal number of columns in that datatable

this is the reason for its failure
kindly check this and let know for any queries or clarification
Cheers @Maryum

@Palaniyappan imageList is of type Sting and I don’t want more columns. I just want to add array values into one column only like this
8

Is there any way to do that?

1 Like

@Palaniyappan Array has image paths which i want to add in a column

awesome
so in that the sequence be like this
–use BUILD DATATABLE activty and build the datatable with that single column structure and get the output with a variable of type datatable named dt
–LETS SAY LIKE WE HAVE THE array variable ready named imageList
–now use a FOR EACH activity and pass the variable imageList as input and change the type argument as string in the property panel of for each loop
–inside the loop use ADD DATAROW activity and mention the array row as {item.tostring}** and in the datatable mention as dt**
–now outside the FOR EACH activity that is next to it use OUTPUT DATATABLE activity and mention the input as dt and get the output with variable of type string named str_output
–then use writeline activity and mention the input as str_input.ToString

Cheers @Maryum

4 Likes

Kindly let know for any queries or clarification
Cheers @Maryum