# Table Component Default Select

**URL:** <https://forum.inductiveautomation.com/t/table-component-default-select/61177>\
**Category:** Ignition\
**Tags:** ignition80, perspective\
**Created:** [June 24, 2022, 5:26pm UTC](https://forum.inductiveautomation.com/t/table-component-default-select/61177 "2022-06-24T17:26:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jose\_Diaz](https://avatars.discourse-cdn.com/v4/letter/j/d9b06d/32.png) [@Jose\_Diaz](https://forum.inductiveautomation.com/u/Jose_Diaz)\
**Post date:** [June 24, 2022, 5:26pm UTC](https://forum.inductiveautomation.com/t/table-component-default-select/61177/1 "2022-06-24T17:26:43Z")

</div>

Hey everyone!

I was having issues on trying to get my table to select the first row whenever I get to a page. Below is a image to showcase my problem. Whenever a user clicks and goes to this page, I would like for my table to auto select the first row so that it populates a trend that is shown on the right side of the table. Currently, I have it working when a user clicks on the row, but I wanted the row to already be selected when it starts up or a user goes to the page for the first time.

Thank you guys in advance!

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/d/fd5ffbd4691419660eb7e174461d1ad3aedbafb8.png)

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [June 24, 2022, 6:00pm UTC](https://forum.inductiveautomation.com/t/table-component-default-select/61177/2 "2022-06-24T18:00:03Z")

</div>

Set `PROPS.selection.selectedRow: 0`

---

<div class="post-metadata">

**Author:** ![Jose\_Diaz](https://avatars.discourse-cdn.com/v4/letter/j/d9b06d/32.png) [@Jose\_Diaz](https://forum.inductiveautomation.com/u/Jose_Diaz)\
**Post date:** [June 24, 2022, 6:40pm UTC](https://forum.inductiveautomation.com/t/table-component-default-select/61177/3 "2022-06-24T18:40:28Z")

</div>

Would I set this on the onStartUp event script for the table? Because I tried to implement but it was still giving me the same problem.

Again, thank you for the response!

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [June 24, 2022, 8:44pm UTC](https://forum.inductiveautomation.com/t/table-component-default-select/61177/4 "2022-06-24T20:44:01Z")

</div>

Create an onStartup event script on the table. Here’s one for the default _Folsom_ table:

```auto
def runAction(self):
	"""
	Method that will run whenever the selected event fires.

	Arguments:
		self: A reference to the component that is invoking this function.
	"""
	self.props.selection.selectedRow = 0
	self.props.selection.selectedColumn = 'city'

```

You can figure this stuff out by playing with the table in the developer. I expected setting `selectedRow` would do the trick but it didn’t do anything until I selected a column as well. It was kind of obvious when I clicked in the table and saw both change in the PROPS view.
