I need to add the list variable data into datatable cell seperated by ","

Hi Team

I have a list variable item ={“F:\Likitha\HC_FIN_19055_2-Billing_Distribution_LATAM\lib\net45\Data\PDF_Attachments\4047837_Q-03835524 Invoice 4047837 SERVICIOS MEDICOS UNIVERSITARIOS.pdf”,F:\Likitha\HC_FIN_19055_2-Billing_Distribution_LATAM\lib\net45\Data\PDF_Attachments\4047837_Q-03835524 Invoice 4047837 SERVICIOS MEDICOS UNIVERSITARIOS.pdf" etc"}

i need to add this item data in datatable in one of the cell each file seperated with “,”

image

for now i am getting item value as system.string in the output

Thanks
likitha

@vinjam_likitha

can you share your listvariables which you have passed in the add data row activity

like which format you have given

or try with below mentioned

image

cheers

Hi @vinjam_likitha

Assign resultString = String.Join(",", item.Select(Function(x) x.ToString()))

Assign dt.Rows(0)("ColumnName") = resultString

use the following:

new Object(){String.Join(",", item), in_CustomerNumber, Bil......}

Hi ,
Assign resultString = String.Join(“,”, item.Select(Function(x) x.ToString()))

Assign dt.Rows(0)(“ColumnName”) = resultString

when i add this logic

F,:,\,L,i,k,i,t,h,a,\,H,C,,F,I,N,,1,9,0,5,5,,2,-,B,i,l,l,i,n,g,,D,i,s,t,r,i,b,u,t,i,o,n,,L,A,T,A,M,\,l,i,b,\,n,e,t,4,5,\,D,a,t,a,\,P,D,F,,A,t,t,a,c,h,m,e,n,t,s,\,4,0,4,7,8,3,5,_,S,U,S,O,N,I,.,p,d,f"
it is coming like this

Thanks in advance
likitha

Hi @vinjam_likitha

items = {“F:\Likitha\HC_FIN_19055_2-Billing_Distribution_LATAM\lib\net45\Data\PDF_Attachments\4047837_Q-03835524 Invoice 4047837 SERVICIOS MEDICOS UNIVERSITARIOS.pdf”,F:\Likitha\HC_FIN_19055_2-Billing_Distribution_LATAM\lib\net45\Data\PDF_Attachments\4047837_Q-03835524 Invoice 4047837 SERVICIOS MEDICOS UNIVERSITARIOS.pdf" etc"}

Join the array values by using join function with separator ‘,’
concatenatedItems = string.Join(",", items)

dataTable.Rows.Add(concatenatedItems)