# Selected rows rowindexes

**URL:** <https://forum.inductiveautomation.com/t/selected-rows-rowindexes/30539>\
**Category:** Ignition Early Access\
**Tags:** perspective\
**Created:** [December 9, 2019, 2:35pm UTC](https://forum.inductiveautomation.com/t/selected-rows-rowindexes/30539 "2019-12-09T14:35:18Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![joostjojo](https://avatars.discourse-cdn.com/v4/letter/j/ac91a4/32.png) [@joostjojo](https://forum.inductiveautomation.com/u/joostjojo)\
**Post date:** [December 9, 2019, 2:35pm UTC](https://forum.inductiveautomation.com/t/selected-rows-rowindexes/30539/1 "2019-12-09T14:35:18Z")

</div>

I have a huge json dataset.  
I can select more rows in the perspective table.

In the props.selection.data propertie I find my rows.  
In the props.selection.selectedRow I find my first selected rowindex.

I want to delete all selected rows in a script.  
the system.dataset.deleteRows() removes only the rows specified by index.  
I dont want to loop through my full dataset because of performance issues occuring then.  
How do I remove the selected jsonrows from props.selection.data from the props.data or how do I know all the rowindexes and not only the first one without the need to loop through the whole table?

---

<div class="post-metadata">

**Author:** ![danieltalbot](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/danieltalbot/32/11201_2.png) [@danieltalbot](https://forum.inductiveautomation.com/u/danieltalbot)\
**Post date:** [August 6, 2020, 9:00pm UTC](https://forum.inductiveautomation.com/t/selected-rows-rowindexes/30539/2 "2020-08-06T21:00:26Z")

</div>

Also ran into this issue when on mobile, trying to select multiple rows. I can add the event.value object to props.selection.data but can’t figure out how to make the table visually reflect multiple selected rows without a keyboard to hold the ‘ctrl’ button.

---

<div class="post-metadata">

**Author:** ![Tim.Johnson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/tim.johnson/32/10597_2.png) [@Tim.Johnson](https://forum.inductiveautomation.com/u/Tim.Johnson)\
**Post date:** [July 9, 2021, 9:46pm UTC](https://forum.inductiveautomation.com/t/selected-rows-rowindexes/30539/3 "2021-07-09T21:46:32Z")

</div>

@joostjojo, I’m having the exact same problem now. Did you ever solve your issue?

I have populated a Perspective Table with data, then will send that data in a query to a database.

My issue is I need some way of deleting multiple rows of the table before I initiate the query.

I would’ve expected the `props.selection.selectedRow` to either change into a list [3,8,11] or something that would indicate when more than one row is selected.

To have to loop through all the `selection.data` to find the indices of those rows seems painful.

@cmallonee, do you or anyone else have a workaround? Maybe this should be a feature request?

---

<div class="post-metadata">

**Author:** ![Tim.Johnson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/tim.johnson/32/10597_2.png) [@Tim.Johnson](https://forum.inductiveautomation.com/u/Tim.Johnson)\
**Post date:** [July 9, 2021, 10:16pm UTC](https://forum.inductiveautomation.com/t/selected-rows-rowindexes/30539/4 "2021-07-09T22:16:15Z")

</div>

> [@Tim.Johnson](#):
>
> Maybe this should be a feature request?

Apparently, it already is.

> **[Perspective Table Multi-Row Selection: selectedRow as an Array | Ignition...](https://ideas.inductiveautomation.com/ignition-features-and-ideas/p/perspective-table-multi-row-selection-selectedrow-as-an-array)**
>
> When selecting multiple rows from a table in Perspective, the selected 'data' property gets filled in with only the data being shown on the screen, and the

As a workaround, I've tested this and it works (for anyone that's still interested):

```auto
# Get the table data
ds = self.parent.parent.getChild("Table").props.data

# Convert dataset to PyDataset for easier iteration
pyData = system.dataset.toPyDataSet(ds)

# Get the selectedData
selectedData = self.parent.parent.getChild("Table").props.selection.data
selRows = []

# Loop through props.selection.data and props.data to find indices of selectedRows
# selRows is the resultant list of rows (indexes) that have been selected
for i in selectedData:
	pos = 0
	for row in pyData:
		if row['ColumnName'] == i['ColumnName']:
			selRows.append(pos)
		pos += 1

# Delete rows based on selRows
ds = system.dataset.deleteRows(ds, selRows)

# Write the dataset back to the table
self.parent.parent.getChild("Table").props.data = ds

# De-select all rows in the table
self.parent.parent.getChild("Table").props.selection.selectedRow = None

```

I still hope they make `props.selection.selectedRow ` return a list of rows actually selected, not just the last one.

---

<div class="post-metadata">

**Author:** ![drewdin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/drewdin/32/3363_2.png) [@drewdin](https://forum.inductiveautomation.com/u/drewdin)\
**Post date:** [June 4, 2026, 1:13am UTC](https://forum.inductiveautomation.com/t/selected-rows-rowindexes/30539/5 "2026-06-04T01:13:34Z")

</div>

I'm still waiting for the fix to be implemented! thanks for the work around

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [June 4, 2026, 2:24am UTC](https://forum.inductiveautomation.com/t/selected-rows-rowindexes/30539/6 "2026-06-04T02:24:58Z")

</div>

I generally post-process the table source data with my toolkit `selectStar()` function to add a column containing the original data row index **within** the table data. As long as this is present in `props.columns`, usually hidden, this extra index will show up in `rowData` as well as filtered and sorted feedback properties.

```python
selectStar(
    {path.to.source.data},
    asMap('sourceIndex', 'I'),
    idx()
)

```
