# Getting the value of the History Provider

**URL:** <https://forum.inductiveautomation.com/t/getting-the-value-of-the-history-provider/33380>\
**Category:** Module Development\
**Created:** [March 24, 2020, 9:41pm UTC](https://forum.inductiveautomation.com/t/getting-the-value-of-the-history-provider/33380 "2020-03-24T21:41:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![fady.machaalani](https://avatars.discourse-cdn.com/v4/letter/f/aca169/32.png) [@fady.machaalani](https://forum.inductiveautomation.com/u/fady.machaalani)\
**Post date:** [March 24, 2020, 9:41pm UTC](https://forum.inductiveautomation.com/t/getting-the-value-of-the-history-provider/33380/1 "2020-03-24T21:41:19Z")

</div>

In Ignition 7 Java code I was able to do the following to get the name of the History Provider when it was enabled.

```auto
String historyProviderName = tag.getAttribute(TagProp.PrimaryHistoryProvider).getValue().toString().toLowerCase();

```

Is there a way to get this same value in Ignition 8 since I can no longer use tag.getAttribute when browsing through tags. I am using browseAsync now to browse tags and it gives me NodeDescriptions, not tags

```auto
Results<NodeDescription> results = provider.browseAsync(parentPath, BrowseFilter.NONE).get(30, TimeUnit.SECONDS);

```

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [March 24, 2020, 9:50pm UTC](https://forum.inductiveautomation.com/t/getting-the-value-of-the-history-provider/33380/2 "2020-03-24T21:50:50Z")

</div>

You would need to build a `TagPath` where the last component is the `PrimaryHistoryProvider` tag prop and then call `readAsync` with that path.

---

<div class="post-metadata">

**Author:** ![fady.machaalani](https://avatars.discourse-cdn.com/v4/letter/f/aca169/32.png) [@fady.machaalani](https://forum.inductiveautomation.com/u/fady.machaalani)\
**Post date:** [March 24, 2020, 10:47pm UTC](https://forum.inductiveautomation.com/t/getting-the-value-of-the-history-provider/33380/3 "2020-03-24T22:47:55Z")

</div>

Here is what I have done from my interpretation of your response.  
I don’t believe this is correct though since I am getting QualityCode.Bad\_NotFound on my tags that have the history provider enabled.

```auto
            TagPath histEnabledPath = new PropertyAlteredTagPath(tagPath, WellKnownTagProps.HistoryProvider);
            List<TagPath> testlist = new ArrayList<>();
            testlist.add(histEnabledPath);
            List<QualifiedValue> valueList = provider.readAsync(testlist, SecurityContext.emptyContext()).get();

            for (QualifiedValue tempValue : valueList) {
                if(tempValue.getQuality() != QualityCode.Bad_NotFound){
                    String historyProviderName = tempValue.getValue().toString();
                }
            }

```

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [March 24, 2020, 10:57pm UTC](https://forum.inductiveautomation.com/t/getting-the-value-of-the-history-provider/33380/4 "2020-03-24T22:57:33Z")

</div>

Hmm. That seems right. You can use `tagPath.getChildPath(WellKnownTagPaths.HistoryProvider)` as a shortcut, but doubt that’s your problem.

Can you read other properties like this? Try reading the Value etc… and make sure the TagPath is correct.

---

<div class="post-metadata">

**Author:** ![fady.machaalani](https://avatars.discourse-cdn.com/v4/letter/f/aca169/32.png) [@fady.machaalani](https://forum.inductiveautomation.com/u/fady.machaalani)\
**Post date:** [March 24, 2020, 11:18pm UTC](https://forum.inductiveautomation.com/t/getting-the-value-of-the-history-provider/33380/5 "2020-03-24T23:18:15Z")

</div>

Perfect, thank you so much - I did have the TagPath incorrectly formatted - I didn’t realize I needed the entire path including the folder it was in: something like this  
`[folderName]/[subFolderName]/[testingTag123]`
