# Gateway timer script to log folder of tags to SQL

**URL:** <https://forum.inductiveautomation.com/t/gateway-timer-script-to-log-folder-of-tags-to-sql/61180>\
**Category:** Ignition\
**Tags:** ignition80, scripting\
**Created:** [June 24, 2022, 6:47pm UTC](https://forum.inductiveautomation.com/t/gateway-timer-script-to-log-folder-of-tags-to-sql/61180 "2022-06-24T18:47:23Z")\
**Posts on this page:** 1\
**Showing post:** 22

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [June 27, 2022, 6:55pm UTC](https://forum.inductiveautomation.com/t/gateway-timer-script-to-log-folder-of-tags-to-sql/61180/22 "2022-06-27T18:55:25Z")

</div>

EDIT: What specific version of Ignition are you using? That hasn’t been stated, yet.

_getResults()_ should work regardless. Let’s start small and work our way up. This is a sample using my server, change to your tag path and see if we can print some values from the script console.

```python
tagPath = '[default]Assembly/3425/Production'

# Browse for tags in a Folder
tags = system.tag.browse(tagPath, {'tagType' : 'AtomicTag'}).getResults()

# Initialize list of tags to read
tagReadList = []

# Add fullpath of each tag from the browse to the list 
for tag in tags:
	# fullpaths are objects so we must coerce them to strings.
	tagReadList.append(str(tag['fullPath']))

# Read the tags. Note that these are qualified values, not just the values.
qvalues = system.tag.readBlocking(tagReadList)

# Print the results. zip() lets us iterate through multiple lists at once.
for tagName, qvalue in zip(tagReadList, qvalues):
	value = qvalue.value
	t_stamp = qvalue.timestamp
	quality = qvalue.quality
	print tagName, value, t_stamp, quality

```

output

```nohighlight
[default]Assembly/3425/Production/actual 696 Mon Jun 27 14:48:29 EDT 2022 Good
[default]Assembly/3425/Production/Efficiency 0.633879780769 Mon Jun 27 14:48:30 EDT 2022 Good
[default]Assembly/3425/Production/Efficiency 60 0.538461506367 Mon Jun 27 14:48:27 EDT 2022 Good
[default]Assembly/3425/Production/goal 1098 Mon Jun 27 14:48:13 EDT 2022 Good
[default]Assembly/3425/Production/total 769 Mon Jun 27 14:48:29 EDT 2022 Good

```

---

_[View the full topic](https://forum.inductiveautomation.com/t/gateway-timer-script-to-log-folder-of-tags-to-sql/61180)._
