Skip to main content
Version: 8.1

system.dataset.deleteRow

This function is used in Python Scripting.

Description​

Takes a dataset and returns a new dataset with the specified rowIndex removed.

note

Datasets are immutable, which means they cannot be directly modified once created. Instead, this scripting function returns a new dataset with some modification applied, which must be assigned to a variable to be used. See Altering a Dataset.

Client Permission Restrictions​

This scripting function has no Client Permission restrictions.

Syntax​

system.dataset.deleteRow(dataset, rowIndex)

Parameters​

TypeParameterDescription
DatasetdatasetThe starting dataset. Please be aware that this dataset will not actually be modified (datasets are immutable), but rather will be the starting point for creating a new dataset.
IntegerrowIndexThe index (starting at 0) of the row to delete. Will throw an IndexError if out of bounds. The maximum bounds is defined by subtracting one from the number of rows in the dataset.

Returns​

Dataset - A new dataset with the specified row removed.

Scope​

Gateway, Vision Client, Perspective Session

Code Examples​

Code Snippet
# This example would remove the selected row from a Vision List component, by re-assigning the List's data property to the new dataset returned by the deleteRow function.

myList = event.source.parent.getComponent("List")
row = myList.selectedIndex
if row != -1: # make sure there is something selected
myList.data = system.dataset.deleteRow(myList.data, row)