# Get Default tagprovider in Perspective project

**URL:** <https://forum.inductiveautomation.com/t/get-default-tagprovider-in-perspective-project/39799>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [October 19, 2020, 1:40pm UTC](https://forum.inductiveautomation.com/t/get-default-tagprovider-in-perspective-project/39799 "2020-10-19T13:40:45Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![SBL\_MC](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/sbl_mc/32/56813_2.png) [@SBL\_MC](https://forum.inductiveautomation.com/u/SBL_MC)\
**Post date:** [October 19, 2020, 1:40pm UTC](https://forum.inductiveautomation.com/t/get-default-tagprovider-in-perspective-project/39799/1 "2020-10-19T13:40:45Z")

</div>

Hi all,

I need to add filters to my alarm lists in a Perspective sessions. I would like to add source as a filter. This would work with Vision, but not perspective. Any ideas on how to get this variable? Thanks.

```
provider = "*"+system.tag.read("[System]Client/System/DefaultTagProvider").value+"*"
return len(system.alarm.queryStatus(state=["ActiveUnacked"],source=provider))
```

---

<div class="post-metadata">

**Author:** ![SBL\_MC](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/sbl_mc/32/56813_2.png) [@SBL\_MC](https://forum.inductiveautomation.com/u/SBL_MC)\
**Post date:** [October 19, 2020, 2:14pm UTC](https://forum.inductiveautomation.com/t/get-default-tagprovider-in-perspective-project/39799/2 "2020-10-19T14:14:58Z")

</div>

Answering myself:

system.tag.getConfiguration() will give you the tag provider, but it needs to be processed further to get only the tagprovider info.

---

<div class="post-metadata">

**Author:** ![SBL\_MC](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/sbl_mc/32/56813_2.png) [@SBL\_MC](https://forum.inductiveautomation.com/u/SBL_MC)\
**Post date:** [October 19, 2020, 2:45pm UTC](https://forum.inductiveautomation.com/t/get-default-tagprovider-in-perspective-project/39799/3 "2020-10-19T14:45:49Z")

</div>

![Screenshot_20201019-164714_Messenger](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/7/f761266434055e03c06d37cb594f15e2f6610039.jpeg)

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [October 19, 2020, 3:52pm UTC](https://forum.inductiveautomation.com/t/get-default-tagprovider-in-perspective-project/39799/4 "2020-10-19T15:52:25Z")

</div>

Wouldn’t your first Script Transform loop for EVERY tag? There’s no guarantee of getting the default provider if you also have others.

---

<div class="post-metadata">

**Author:** ![SBL\_MC](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/sbl_mc/32/56813_2.png) [@SBL\_MC](https://forum.inductiveautomation.com/u/SBL_MC)\
**Post date:** [October 20, 2020, 6:31am UTC](https://forum.inductiveautomation.com/t/get-default-tagprovider-in-perspective-project/39799/5 "2020-10-20T06:31:04Z")

</div>

Bit unsure if we follow? It has been tested on gateways with multiple providers.

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [October 20, 2020, 4:20pm UTC](https://forum.inductiveautomation.com/t/get-default-tagprovider-in-perspective-project/39799/6 "2020-10-20T16:20:49Z")

</div>

The docs led me to believe `getConfiguration()` expected arguments, but it looks like we default back to the default provider of the project when running in the Perspective context.

Your script can actually be “simplified” a bit, and contained in one transform:

```auto
project_default_provider = '*' + str(system.tag.getConfiguration()[0]['path']).lstrip('[').rstrip(']') + '*'
return len(system.alarm.queryStatus(state=['ActiveUnacked'], source=[project_default_provider]))

```

---

<div class="post-metadata">

**Author:** ![SBL\_MC](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/sbl_mc/32/56813_2.png) [@SBL\_MC](https://forum.inductiveautomation.com/u/SBL_MC)\
**Post date:** [October 21, 2020, 12:08pm UTC](https://forum.inductiveautomation.com/t/get-default-tagprovider-in-perspective-project/39799/7 "2020-10-21T12:08:46Z")

</div>

Thanks for the input. 🙂
