# Grabbing data value from a dataset into a memory tag

**URL:** <https://forum.inductiveautomation.com/t/grabbing-data-value-from-a-dataset-into-a-memory-tag/7789>\
**Category:** Ignition\
**Created:** [January 6, 2014, 8:41pm UTC](https://forum.inductiveautomation.com/t/grabbing-data-value-from-a-dataset-into-a-memory-tag/7789 "2014-01-06T20:41:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![adamabelew](https://avatars.discourse-cdn.com/v4/letter/a/97f17d/32.png) [@adamabelew](https://forum.inductiveautomation.com/u/adamabelew)\
**Post date:** [January 6, 2014, 8:41pm UTC](https://forum.inductiveautomation.com/t/grabbing-data-value-from-a-dataset-into-a-memory-tag/7789/1 "2014-01-06T20:41:07Z")

</div>

It seems I am missing something as I am sure this is simple. I have a table that I want to get a value from the dataset and store into a memory tag. This is what I currently have:

```auto
# Get the dataset from the Table component & Convert to PyDataSet
ds = event.source.parent.getComponent('Table').data # table component name is "Table"
pds = system.dataset.toPyDataSet(ds)

# Grab the second item of the first row
strTag = pds[0][1] # strTag is a memory tag defined as a STRING
```

When I run this code, I do not get any results, and the Output Console does not show any errors. Can anyone see what I am missing? I tried this same code with the data as a DataSet as well as pyDataSet.

Thanks

---

<div class="post-metadata">

**Author:** ![Duffanator](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/duffanator/32/3560_2.png) [@Duffanator](https://forum.inductiveautomation.com/u/Duffanator)\
**Post date:** [January 6, 2014, 8:53pm UTC](https://forum.inductiveautomation.com/t/grabbing-data-value-from-a-dataset-into-a-memory-tag/7789/2 "2014-01-06T20:53:31Z")

</div>

All you’re doing is assigning the value from the table to the python variable “strTag”.

To actually write to your memory tag you have to use the system.tag.write() function like so:

```auto
# Get the dataset from the Table component & Convert to PyDataSet
ds = event.source.parent.getComponent('Table').data # table component name is "Table"
pds = system.dataset.toPyDataSet(ds)

# Grab the second item of the first row
strTag = pds[0][1] # strTag is a memory tag defined as a STRING
system.tag.write("Path/To/Tag",strTag)
```

---

<div class="post-metadata">

**Author:** ![adamabelew](https://avatars.discourse-cdn.com/v4/letter/a/97f17d/32.png) [@adamabelew](https://forum.inductiveautomation.com/u/adamabelew)\
**Post date:** [January 7, 2014, 3:43am UTC](https://forum.inductiveautomation.com/t/grabbing-data-value-from-a-dataset-into-a-memory-tag/7789/3 "2014-01-07T03:43:06Z")

</div>

system.tag.write() did the trick !!

I knew I was missing something small.

Thanks…
