# Tags value to dataset

**URL:** <https://forum.inductiveautomation.com/t/tags-value-to-dataset/45590>\
**Category:** Ignition\
**Tags:** scripting\
**Created:** [April 14, 2021, 2:49pm UTC](https://forum.inductiveautomation.com/t/tags-value-to-dataset/45590 "2021-04-14T14:49:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kevin\_DLeon](https://avatars.discourse-cdn.com/v4/letter/k/c4cdca/32.png) [@Kevin\_DLeon](https://forum.inductiveautomation.com/u/Kevin_DLeon)\
**Post date:** [April 14, 2021, 2:49pm UTC](https://forum.inductiveautomation.com/t/tags-value-to-dataset/45590/1 "2021-04-14T14:49:41Z")

</div>

hello, i want to make a dataset with the values of a n number of tags, in this case i have a folder with 3 int tags and i have this code but it gives me the error: “list indices must be integers”

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

1st I declare the 2 datasets  
2nd I get all the paths in tagDS  
3rd I try to get the values but it is when the error appears  
it gives me the error at line 9 but i can not see how to fix this, thank you.

---

<div class="post-metadata">

**Author:** ![zacht](https://avatars.discourse-cdn.com/v4/letter/z/ea5d25/32.png) [@zacht](https://forum.inductiveautomation.com/u/zacht)\
**Post date:** [April 14, 2021, 3:05pm UTC](https://forum.inductiveautomation.com/t/tags-value-to-dataset/45590/2 "2021-04-14T15:05:26Z")

</div>

I think the thing that’s getting you is `tagDS[tag]`. In the loop `for tag in tags:`, `tag` is not a number it’s an object. What version of Ignition are you using.? You can use system.tag.readBlocking() or system.tag.readAsync() to read many items at a time, so this looping may not be necessary.

---

<div class="post-metadata">

**Author:** ![Kevin\_DLeon](https://avatars.discourse-cdn.com/v4/letter/k/c4cdca/32.png) [@Kevin\_DLeon](https://forum.inductiveautomation.com/u/Kevin_DLeon)\
**Post date:** [April 14, 2021, 3:11pm UTC](https://forum.inductiveautomation.com/t/tags-value-to-dataset/45590/3 "2021-04-14T15:11:40Z")

</div>

Hello, thanks for reply; i am using 8.1 edge; i had tried another script but seems not work neither.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/f/1fa663b6dd0da81ec9cff48355d68514950d63b3.png)

by the way; how is that about the readblocking to avoid the loop? could you be so kind to explain to me? i have read in the documentation that functions but i tought it would be the same

---

<div class="post-metadata">

**Author:** ![Kevin\_DLeon](https://avatars.discourse-cdn.com/v4/letter/k/c4cdca/32.png) [@Kevin\_DLeon](https://forum.inductiveautomation.com/u/Kevin_DLeon)\
**Post date:** [April 14, 2021, 3:14pm UTC](https://forum.inductiveautomation.com/t/tags-value-to-dataset/45590/4 "2021-04-14T15:14:37Z")

</div>

i fixed that, i discover the way, thanks you so much! 🙂
