# How to populate Component Input Fields From a Tables Row Selection Based on ID

**URL:** <https://forum.inductiveautomation.com/t/how-to-populate-component-input-fields-from-a-tables-row-selection-based-on-id/37531>\
**Category:** Ignition\
**Created:** [August 9, 2020, 5:27pm UTC](https://forum.inductiveautomation.com/t/how-to-populate-component-input-fields-from-a-tables-row-selection-based-on-id/37531 "2020-08-09T17:27:27Z")\
**Posts on this page:** 6\
**Page:** 2

<div class="post-metadata">

**Author:** ![jshaffer09](https://avatars.discourse-cdn.com/v4/letter/j/df788c/32.png) [@jshaffer09](https://forum.inductiveautomation.com/u/jshaffer09)\
**Post date:** [August 12, 2020, 2:26pm UTC](https://forum.inductiveautomation.com/t/how-to-populate-component-input-fields-from-a-tables-row-selection-based-on-id/37531/21 "2020-08-12T14:26:49Z")

</div>

do you mean with the print statement? It didn’t print anything out

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [August 12, 2020, 4:00pm UTC](https://forum.inductiveautomation.com/t/how-to-populate-component-input-fields-from-a-tables-row-selection-based-on-id/37531/22 "2020-08-12T16:00:12Z")

</div>

If you run the code in the script console does it work?

Note: You will need to supply appropriate values as the script console will not have access to components.

---

<div class="post-metadata">

**Author:** ![jshaffer09](https://avatars.discourse-cdn.com/v4/letter/j/df788c/32.png) [@jshaffer09](https://forum.inductiveautomation.com/u/jshaffer09)\
**Post date:** [August 12, 2020, 5:10pm UTC](https://forum.inductiveautomation.com/t/how-to-populate-component-input-fields-from-a-tables-row-selection-based-on-id/37531/23 "2020-08-12T17:10:24Z")

</div>

no, it give a error for “event is not defined”

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [August 12, 2020, 5:28pm UTC](https://forum.inductiveautomation.com/t/how-to-populate-component-input-fields-from-a-tables-row-selection-based-on-id/37531/24 "2020-08-12T17:28:55Z")

</div>

That is because the script console doesn’t have access to the event object. You will need to provide appropriate hard coded values for the query.

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [August 12, 2020, 5:40pm UTC](https://forum.inductiveautomation.com/t/how-to-populate-component-input-fields-from-a-tables-row-selection-based-on-id/37531/25 "2020-08-12T17:40:51Z")

</div>

I think you need to spend some more time getting familiar with SQL and Ignition software. Remember, there are tons of videos out there.

---

<div class="post-metadata">

**Author:** ![jshaffer09](https://avatars.discourse-cdn.com/v4/letter/j/df788c/32.png) [@jshaffer09](https://forum.inductiveautomation.com/u/jshaffer09)\
**Post date:** [August 13, 2020, 8:12pm UTC](https://forum.inductiveautomation.com/t/how-to-populate-component-input-fields-from-a-tables-row-selection-based-on-id/37531/26 "2020-08-13T20:12:47Z")

</div>

I found the issue. The arg for EquipmentID was in the wrong place.

[Previous page](https://forum.inductiveautomation.com/t/how-to-populate-component-input-fields-from-a-tables-row-selection-based-on-id/37531.md?page=1)
