Extracting tag name though script?

Hello, i am trying to get an event log to update through a tag change script on the folder, this is fine but i cannot figure out how to extract the tag name and the state. Essentially what i want to do it this

Blockquote
rootPath = '[default]DTL_Ramps/Ramp PLC Connection Tags/Ramp1/Event'
tags = system.tag.browse(rootPath)
values = [i['value'].value for i in tags]
if (any(values)) != 0:
Parameters = system.tag.readBlocking(values.TagName+Value)
system.db.runNamedQuery("EventLog", Parameters)

So if any event turns on i want to grab the name of it and run it through a query as a parameter,
would appreciate if anybody had the knowledge to share.

See this thread:

Are you wanting to do this on a tag valueChange event or on a Tag Change event in the gateway?

I would probably avoid running a script like this in a valueChange event. A long running script (longer than ~100ms) can result in missed events do to the way that valueChange events work.

1 Like

its on a gateway tag change event looking at the whole events folder