datatable datatable.clone(datatable dataTable)
This example shows you how to create a clone of a datatable. The cloned datatable is a new instance and modifications to the cloned datatable do not modify the original datatable and vice versa.
{buffer.set(table1, datatable.createempty(Name, Age))} {datatable.rows.add($table1, 'Peter', 12)} {datatable.rows.add($table1, 'Fred', 35)} {buffer.set(table2, datatable.clone($table1))} {datatable.setvalue($table2, 1, Name, 'Peter Pan')} {datatable.setvalue($table2, 2, Name, 'Fred Flintstone')} Original table: {datatable.simpleformat($table1)} Cloned and modified table: {datatable.simpleformat($table2)}