system.dataset.setValue
This function is used in Python Scripting.
Description​
Takes a dataset and returns a new dataset with one value altered. Datasets are immutable, so it is important to realize that this function does not actually set a value in the argument dataset. You'll need to do something with the new dataset that this function creates to achieve something useful.
Client Permission Restrictions​
This scripting function has no Client Permission restrictions.
Syntax (columnName)​
system.dataset.setValue(dataset, rowIndex, columnName, value)
Parameters​
Type | Parameter | Description |
---|---|---|
Dataset | dataset | The starting dataset. Will not be modified (datasets are immutable), but acts as the basis for the returned dataset. |
int | rowIndex | The index of the row to set the value at (starting at 0) |
String | columnName | The name of the column to set the value at. Case insensitive. |
PyObject | value | The new value for the specified row/column. |
Returns​
Dataset - A new dataset, with the new value set at the given location.
Scope​
All
Syntax (columnIndex)​
system.dataset.setValue(dataset, rowIndex, columnIndex, value)
Parameters​
Type | Parameter | Description |
---|---|---|
Dataset | dataset | The starting dataset. Will not be modified (datasets are immutable), but acts as the basis for the returned dataset. |
int | rowIndex | The index of the row to set the value at (starting at 0) |
String | columnIndex | The index of the column to set the value at (starting at 0) |
PyObject | value | The new value for the specified row/column. |
Returns​
Dataset - A new dataset, with the new value set at the given location.
Scope​
All
Code Examples​
Example 1
# This snippet could be used for a Button's actionPerformed event to change the selected cell's value in a Table component to zero.
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, selCol, 0.0)
table.data = newData