Is it possible to get the tag path from a binding using a Python script?

I’m developing in Perspective module (avoiding confusion on response)

I’m trying to track the last user that adjusted the value of a setpoint using a numeric input control that is bidirectionally bound to a tag.

I added a custom property to the tag to store the user name of whoever last edited the value and I know I can write to that property with a tag write in my script. I also know how to get the user name logged in to the current session.

I’m trying to make the script dynamically get the tag path from a binding so my script that writes the user name to the custom property can be more generic. I would do this as a template and pass the tag path into a template but this is a pre-existing system with many numeric inputs that they want to track now.

Is there a way to read the tag that a field is bound to using Python?

I can’t help with your Perspective query, but you could also do this from the audit log and return the latest entry for that tag and pulling out the user. IMO this would be more reliable and would avoid reinventing the wheel

1 Like

Thanks for the idea. I’m not sure I can get an audit log set up on this system because of my access limitations but it’s definitely worth looking into.

I would always setup this up on every project - you never know when it will become useful! (case in point)

Ok, I got that set up and it’s working. I have a little concern about querying from that table because indexing on a string could be problematic as the table gets bigger but I’ll cross that bridge when I come to it.

Thanks.