Good evening
I am a user of UiPath Studio 2025.0.197STS Community edition.
What I want to do
After creating a DataRow array arr_dr, I want to create an empty DataTable dt2, iterate through another DataTable dt using the ForEachRow activity, and add the DataRow array arr_dr to dt2 using the AddDataRow activity.
After adding the DataRow array arr_dr to dt2 and performing WriteRange (workbook), I got the output as shown in the attached image. What could be the cause?
System.Data.DataRow indicates you’re adding the DataRow object instead of its values. Try using Row.ItemArray in the ArrayRow property of Add Data Row.
If that doesn’t work, could you share how you created arr_dr?
Unfortunately, I cannot accept your suggestion.
The reason is that setting Row.ItemArray with the Row’s ArrayRow property assigns the Row from dt instead of dt2.
Your suggested method will work, but I confirmed that if you execute dt2=dt.Copy() beforehand, you can also loop through the ForEachRow activity with Row.