# Remote Tag Provider History Queries

**URL:** <https://forum.inductiveautomation.com/t/remote-tag-provider-history-queries/93632>\
**Category:** Ignition\
**Tags:** scripting, ignition81\
**Created:** [July 23, 2024, 8:17pm UTC](https://forum.inductiveautomation.com/t/remote-tag-provider-history-queries/93632 "2024-07-23T20:17:15Z")\
**Posts on this page:** 1\
**Showing post:** 30

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [October 23, 2024, 2:51am UTC](https://forum.inductiveautomation.com/t/remote-tag-provider-history-queries/93632/30 "2024-10-23T02:51:11Z")

</div>

At a risk of sounding stupid...  
The historical tag provider originating connection names _are_ stored in the internal DB. Could you cache this? Obviously using an API method to get this would be better, but in a pinch..

> [@\[FEATURE\] Adding pens to ad-hoc to a trend - Missing exposure to functions needed](https://forum.inductiveautomation.com/t/feature-adding-pens-to-ad-hoc-to-a-trend-missing-exposure-to-functions-needed/92432/2):
>
> E.g. using a super dodgy query on the internal db... tagPath = 'Tag/Path' # get the tag provider in the local gateway from the config in case the tag provider wasn't provided in the path tagProvider = system.tag.getConfiguration(tagPath)[0]['path'].split(']')[-1] context = system.util.getContext() session = context.getPersistenceInterface().getSession() try: query = """ SELECT COALESCE(gtps.PROVIDERNAME, tps.NAME) as tag\_provider, gtps.HISTORYDRIVERNAME as gateway\_name FROM TAGPROVI…

---

_[View the full topic](https://forum.inductiveautomation.com/t/remote-tag-provider-history-queries/93632)._
