# PyDataset Value Into Table

**URL:** <https://forum.inductiveautomation.com/t/pydataset-value-into-table/108741>\
**Category:** Ignition\
**Tags:** ignition81, vision\
**Created:** [July 21, 2025, 7:41pm UTC](https://forum.inductiveautomation.com/t/pydataset-value-into-table/108741 "2025-07-21T19:41:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![warren](https://avatars.discourse-cdn.com/v4/letter/w/97f17d/32.png) [@warren](https://forum.inductiveautomation.com/u/warren)\
**Post date:** [July 21, 2025, 7:41pm UTC](https://forum.inductiveautomation.com/t/pydataset-value-into-table/108741/1 "2025-07-21T19:41:26Z")

</div>

I have a script running to bring a selected value into a Vision table:

```python
InsertAssist = ("SELECT matAssist FROM usermaterials WHERE materialName = ?")
args2 = [selected_material]
assist = system.db.runPrepQuery(InsertAssist, args2)
if selRow != -1 and selCol != -1:
   newData = system.dataset.setValue(table.data, selRow, selCol2, assist)
   table.data = newData

```

But, my result is showing:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/optimized/3X/5/6/568508f9984cc33653464f36fc3b9d49fa916a99_2_690x48.png)

How can I get the value out of this pydataset? The select query is providing the "name" to be asserted into this cell, so I need that actual value pulled by the prepquery.

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [July 21, 2025, 7:46pm UTC](https://forum.inductiveautomation.com/t/pydataset-value-into-table/108741/2 "2025-07-21T19:46:48Z")

</div>

A scalar prep query will return a value not a pydataset.  
[system.db.runScalarPrepQuery | Ignition User Manual](https://docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-db/system-db-runScalarPrepQuery)

For the future, you can get values from pydatasets a few ways:

```python
# for loop
for row in assist:
    someVal = row['columnName']

# or indexing for row zero and column by name
someVal = assist[0]['columnName']
```

---

<div class="post-metadata">

**Author:** ![warren](https://avatars.discourse-cdn.com/v4/letter/w/97f17d/32.png) [@warren](https://forum.inductiveautomation.com/u/warren)\
**Post date:** [July 21, 2025, 7:53pm UTC](https://forum.inductiveautomation.com/t/pydataset-value-into-table/108741/3 "2025-07-21T19:53:10Z")

</div>

Thank you! I was not aware of this difference
