# Selection high light of first row in the SQL table

**URL:** <https://forum.inductiveautomation.com/t/selection-high-light-of-first-row-in-the-sql-table/69814>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [February 14, 2023, 7:30am UTC](https://forum.inductiveautomation.com/t/selection-high-light-of-first-row-in-the-sql-table/69814 "2023-02-14T07:30:49Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Elangovan\_Packirisam](https://avatars.discourse-cdn.com/v4/letter/e/ecccb3/32.png) [@Elangovan\_Packirisam](https://forum.inductiveautomation.com/u/Elangovan_Packirisam)\
**Post date:** [February 14, 2023, 7:30am UTC](https://forum.inductiveautomation.com/t/selection-high-light-of-first-row-in-the-sql-table/69814/1 "2023-02-14T07:30:49Z")

</div>

I would like to highlight the first row of a SQL record in the table while the page is opened first time. Basically, default row selection would be the first record. This is for Perspective. I used screen startup event and wrote zero value to selectedRow which doesb't work, Can anyone help me with this?

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

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [February 14, 2023, 8:15am UTC](https://forum.inductiveautomation.com/t/selection-high-light-of-first-row-in-the-sql-table/69814/2 "2023-02-14T08:15:22Z")

</div>

Setting the selectedRow to 0 should work; especially if the event is being fired directly from the table. I notice that there is a star next to the onStartup indicating the the script has not been applied. This is likely the issue.

---

<div class="post-metadata">

**Author:** ![Elangovan\_Packirisam](https://avatars.discourse-cdn.com/v4/letter/e/ecccb3/32.png) [@Elangovan\_Packirisam](https://forum.inductiveautomation.com/u/Elangovan_Packirisam)\
**Post date:** [February 14, 2023, 9:25am UTC](https://forum.inductiveautomation.com/t/selection-high-light-of-first-row-in-the-sql-table/69814/3 "2023-02-14T09:25:53Z")

</div>

I tried both the method. both are not working. That \* symbol comes a few seconds later I open the "configure event" popup

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [February 14, 2023, 9:44am UTC](https://forum.inductiveautomation.com/t/selection-high-light-of-first-row-in-the-sql-table/69814/4 "2023-02-14T09:44:54Z")

</div>

Hmmm. Is enableRowSelection True?  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/3/83a98ce22cdf7b10ca139ded3d6a1d8bd5c2ae6c.png)

---

<div class="post-metadata">

**Author:** ![mcgheeiv](https://avatars.discourse-cdn.com/v4/letter/m/71c47a/32.png) [@mcgheeiv](https://forum.inductiveautomation.com/u/mcgheeiv)\
**Post date:** [February 14, 2023, 10:36am UTC](https://forum.inductiveautomation.com/t/selection-high-light-of-first-row-in-the-sql-table/69814/5 "2023-02-14T10:36:27Z")

</div>

It might be easier to use an expression binding of 0 on selectedRow.

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [February 14, 2023, 10:44am UTC](https://forum.inductiveautomation.com/t/selection-high-light-of-first-row-in-the-sql-table/69814/6 "2023-02-14T10:44:28Z")

</div>

> [@mcgheeiv](#):
>
> use an expression binding

How would you write that, so it doesn't keep the selection at zero and make other rows essentially not selectable?

---

<div class="post-metadata">

**Author:** ![mcgheeiv](https://avatars.discourse-cdn.com/v4/letter/m/71c47a/32.png) [@mcgheeiv](https://forum.inductiveautomation.com/u/mcgheeiv)\
**Post date:** [February 14, 2023, 11:18am UTC](https://forum.inductiveautomation.com/t/selection-high-light-of-first-row-in-the-sql-table/69814/7 "2023-02-14T11:18:20Z")

</div>

Bindings run when the view opens and when something in the binding changes. Since nothing in the binding is changing, it only runs when the view opens.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/b/0b3586db3997b4c7c5fbdf516fc694b736824e54.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/7/a724629420058c6b7bfa1f885d16d1c4b5721dc7.png)

---

<div class="post-metadata">

**Author:** ![Elangovan\_Packirisam](https://avatars.discourse-cdn.com/v4/letter/e/ecccb3/32.png) [@Elangovan\_Packirisam](https://forum.inductiveautomation.com/u/Elangovan_Packirisam)\
**Post date:** [February 14, 2023, 11:37am UTC](https://forum.inductiveautomation.com/t/selection-high-light-of-first-row-in-the-sql-table/69814/8 "2023-02-14T11:37:08Z")

</div>

yes, enableRowSelection is True

---

<div class="post-metadata">

**Author:** ![Elangovan\_Packirisam](https://avatars.discourse-cdn.com/v4/letter/e/ecccb3/32.png) [@Elangovan\_Packirisam](https://forum.inductiveautomation.com/u/Elangovan_Packirisam)\
**Post date:** [February 20, 2023, 5:19am UTC](https://forum.inductiveautomation.com/t/selection-high-light-of-first-row-in-the-sql-table/69814/9 "2023-02-20T05:19:39Z")

</div>

the concept is simple that selectedRow should be written zero. But I tried in different methods, it doesn't seem to be working

---

<div class="post-metadata">

**Author:** ![Elangovan\_Packirisam](https://avatars.discourse-cdn.com/v4/letter/e/ecccb3/32.png) [@Elangovan\_Packirisam](https://forum.inductiveautomation.com/u/Elangovan_Packirisam)\
**Post date:** [February 20, 2023, 5:20am UTC](https://forum.inductiveautomation.com/t/selection-high-light-of-first-row-in-the-sql-table/69814/10 "2023-02-20T05:20:58Z")

</div>

I tried this method, it is not working. even, I tried to make a condition that if selectedRow == 'None':  
selectedRow =0.  
Even this one is not working

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [February 20, 2023, 6:32am UTC](https://forum.inductiveautomation.com/t/selection-high-light-of-first-row-in-the-sql-table/69814/11 "2023-02-20T06:32:59Z")

</div>

I tested mcgheeiv's method, and it worked. The binding shouldn't read `selectedRow =0`. It should simply read `0`

I'm not sure what the problem could be. What browser are you using? What is the operating system?

---

<div class="post-metadata">

**Author:** ![Elangovan\_Packirisam](https://avatars.discourse-cdn.com/v4/letter/e/ecccb3/32.png) [@Elangovan\_Packirisam](https://forum.inductiveautomation.com/u/Elangovan_Packirisam)\
**Post date:** [February 20, 2023, 9:05am UTC](https://forum.inductiveautomation.com/t/selection-high-light-of-first-row-in-the-sql-table/69814/12 "2023-02-20T09:05:45Z")

</div>

I have noted that my right table linked with left table is selected the first row. Which is fine, only one thing is not working. the selected first row in the left side table is not highlighted with blue color indication (we have this blue color indication on the selection, I guess that the default color too).

That's the only thing is to be resolved.

Operating system is Windows 10. and the browser is google Chrome
