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
This is my Datatable
This is what I’m giving in Add Data Row
And this is my result
Kindly guide me on this. Really appreciate your help
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
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