# Historical Tag Path in Ignition SDK

**URL:** <https://forum.inductiveautomation.com/t/historical-tag-path-in-ignition-sdk/11074>\
**Category:** 3rd Party Modules\
**Created:** [January 20, 2016, 4:46pm UTC](https://forum.inductiveautomation.com/t/historical-tag-path-in-ignition-sdk/11074 "2016-01-20T16:46:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![cody.tamaki](https://avatars.discourse-cdn.com/v4/letter/c/b487fb/32.png) [@cody.tamaki](https://forum.inductiveautomation.com/u/cody.tamaki)\
**Post date:** [January 20, 2016, 4:46pm UTC](https://forum.inductiveautomation.com/t/historical-tag-path-in-ignition-sdk/11074/1 "2016-01-20T16:46:30Z")

</div>

I’m trying to write a historical query from a component in a module I’m developing. I’m using the standard gateway interface “runTagHistoryQuery” function. It’s all working very well, except I have to set it up with a fully qualified tag path in the client (histprov:historian:/drv:ignition-cody-pc:default:/tag:tags/ramp/ramp0). Obviously I think this is far from intuitive for someone to use so I’d like to whittle my tag path down to one or all of the following:  
[ul]

1. tags/ramp/ramp0
2. [~]tags/ramp/ramp0
3. [historian/ignition-cody-pc:default]tags/ramp/ramp0  
[/ul]

Now my question is, how do I take a less than fully qualified tag path from the client and turn it into the a fully qualified historical tag path. I can retrieve the default data source and default tag provider from the client context with:

```auto
    ClientContext context = getAppContext();
    defaultDatasource = context.getDefaultDatasourceName();
    defaultTagProvider = context.getDefaultSQLTagsProviderName();
```

But I’m missing the system name. So I guess my question is  
[ul]

1. What java Class would I use to get the system name?
2. Am I even approaching this the right way or is there already a class to do this? (I’ve found classes to parse SQL tag paths but not historical).  
[/ul]

Thanks!

---

<div class="post-metadata">

**Author:** ![cody.tamaki](https://avatars.discourse-cdn.com/v4/letter/c/b487fb/32.png) [@cody.tamaki](https://forum.inductiveautomation.com/u/cody.tamaki)\
**Post date:** [January 21, 2016, 5:38pm UTC](https://forum.inductiveautomation.com/t/historical-tag-path-in-ignition-sdk/11074/2 "2016-01-21T17:38:55Z")

</div>

Ok so with the help of Kyle Chase I’ve retrieved the system name via an RPC call to query the gateway’s internal database.

```auto
    PersistenceInterface gwDBInterface = context.getPersistenceInterface();
    PersistentRecord systemRecord = gwDBInterface.find(SystemPropertiesRecord.META, 0);

    return systemRecord.getString(SystemPropertiesRecord.SystemName);
```

Now I still have to wonder, isn’t there an easier/better way?

---

<div class="post-metadata">

**Author:** ![djs](https://avatars.discourse-cdn.com/v4/letter/d/e47774/32.png) [@djs](https://forum.inductiveautomation.com/u/djs)\
**Post date:** [March 14, 2026, 5:57pm UTC](https://forum.inductiveautomation.com/t/historical-tag-path-in-ignition-sdk/11074/3 "2026-03-14T17:57:27Z")

</div>

Hey Cody, did you ever find out if there's a better way? I'm trying to figure out how to handle these properly myself...

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [March 14, 2026, 11:24pm UTC](https://forum.inductiveautomation.com/t/historical-tag-path-in-ignition-sdk/11074/4 "2026-03-14T23:24:54Z")

</div>

The proper way to do this nowadays is to use [getSystemPropertiesManager()](https://sdk.inductiveautomation.com/javadoc/ignition83/8.3.4/com/inductiveautomation/ignition/gateway/model/GatewayContext.html#getSystemPropertiesManager()) on the `GatewayContext`, and call that object's [getSystemName()](https://sdk.inductiveautomation.com/javadoc/ignition83/8.3.4/com/inductiveautomation/ignition/gateway/model/SystemPropertiesManager.html#getSystemName()).

In jython, you can use the netbeans shortcut properties (and should--they are more efficient).

---

<div class="post-metadata">

**Author:** ![djs](https://avatars.discourse-cdn.com/v4/letter/d/e47774/32.png) [@djs](https://forum.inductiveautomation.com/u/djs)\
**Post date:** [March 16, 2026, 6:43pm UTC](https://forum.inductiveautomation.com/t/historical-tag-path-in-ignition-sdk/11074/5 "2026-03-16T18:43:03Z")

</div>

Thanks!
