I find a way to add data row to datatable, Who have a better way please tell me

datatable
excel
activities

#1

In my project, Need to change the header of excel, and read data from another excels to this excel. merge the data by headers, i should automatically to create Headers and fill data
I use this way to do that:

because i can not upload the file, :<

first i build a excel just contains the header, (Headers.xlsx)
(if users change the headers they do not change the UIpath code, instead just change the Headers.xlsx )

then use the [read range] method(chose add headers) as TestDT

then use [add datarow] method (arrayRow fill into {“0”} as the place holder)

last use [for each]:
item in (Datatable.column) to get each column name.
in the loop use [assign] method
TestDT(TestDt.Rows.Count - 1)(item) = someDataFromAnotherExcel

so they can automatically to create Headers and fill data

but i thought this way is not good, i want to know if has a simpler way to finish.

And forgive my poor English level :<