Skip to main content
Version: 7.9

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

TypeParameterDescription
DatasetdatasetThe starting dataset. Will not be modified (datasets are immutable), but acts as the basis for the returned dataset.
introwIndexThe index of the row to set the value at (starting at 0)
StringcolumnNameThe name of the column to set the value at. Case insensitive.
PyObjectvalueThe 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

TypeParameterDescription
DatasetdatasetThe starting dataset. Will not be modified (datasets are immutable), but acts as the basis for the returned dataset.
introwIndexThe index of the row to set the value at (starting at 0)
StringcolumnIndexThe index of the column to set the value at (starting at 0)
PyObjectvalueThe 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