Writing to data Table from a multiple Columns (Source Data)

Hi team,

I have a desterilized Xml data that I need to add data of multiple columns (Source data) into data table.
When I try to see for one column using
currentItem.Element(xns_WD+“primaryWorkEmail”).Value expression I am able to get all emails under primaryWorkEmail columns
I’ll like to do the same of multiple columns simultaneously for all the columns
{“Employee_ID”,“Full_Name”,“primaryWorkEmail”,“Hire_Date”, “businessTitle”}
Can anyone help with the expression that can handle that?
Please see the screenshot for more clarity

Thanks for your help!

Hi @Sisay_Dinku ,
You can add multiple columns in datatable using (AddRange)method.
Need to use Invoke Method
TargetObject - datatable Variable.Columns
MethodName - AddRange
Parameters -
IN - DataColumn - { new DataColumn (“columnName1”), new DataColumn (“columnName2”) }

Regards,
LNV

1 Like

Hi @Luong_Nguyen1
Thank you for taking the time to look into this.

I already have these columns in the data table. I do no intend to add new columns into the data table. Instead, I was looking for a solution (expression) that can enable me to load a decentralized xml data into those columns in the data table in for each loop. And I’ve found out that the following expression working
{currentItem.Element(xns_WD+ “Employee_ID”).Value, currentItem.Element(xns_WD+“Full_Name”).Value, currentItem.Element(xns_WD+“primaryWorkEmail”).Value, currentItem.Element(xns_WD+“Hire_Date”).Value, currentItem.Element(xns_WD+“businessTitle”).Value}

in short, this issue has been resolved. Thanks for the effort!

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