Using system.data.setValue to prefill more than 1 column

I’m trying to pre-fill values on 2 columns,

I’m testing it on the sample code I saw on the manual

table = event.source.parent.getComponent("Table") selRow = table.getSelectedRow() selCol = table.getSelectedColumn() if selRow != -1 and selCol != -1: newData = system.dataset.setValue(table.data, selRow, 'C', 'Test1') table.data = newData

I also want to prefill another value on column ‘D’ with the value ‘Test2’ on the same row. What’s the correct syntax for that?

Thank You

Like this:

table = event.source.parent.getComponent("Table")
selRow = table.getSelectedRow()
selCol = table.getSelectedColumn()
if selRow != -1 and selCol != -1:
   newData = system.dataset.setValue(table.data, selRow, 'C', 'Test1')
   newData = system.dataset.setValue(newData, selRow, 'D', 'Test2')
   table.data = newData

Great. Thanks!