# Expression Tag Referencing \[System\] Tags

**URL:** <https://forum.inductiveautomation.com/t/expression-tag-referencing-system-tags/14075>\
**Category:** Ignition\
**Created:** [April 18, 2017, 7:28pm UTC](https://forum.inductiveautomation.com/t/expression-tag-referencing-system-tags/14075 "2017-04-18T19:28:19Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jim\_Jensen](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jim_jensen/32/3317_2.png) [@Jim\_Jensen](https://forum.inductiveautomation.com/u/Jim_Jensen)\
**Post date:** [April 18, 2017, 7:28pm UTC](https://forum.inductiveautomation.com/t/expression-tag-referencing-system-tags/14075/1 "2017-04-18T19:28:19Z")

</div>

I am trying to create an expression tag (boolean type) that is set based upon a user’s role using the following expression:

```auto
hasRole("Administrator")

```

This results in an Evaluation Error (Function ‘hasRole(role, username, usersource)’ does not work with 1 arguments.

I have also tried to create an expression tag (string type) using the following expression:

```auto
{[System]Client/User/RolesString}

```

This results in a REFERENCE\_NOT\_FOUND error.

Can expression tags reference tags located in the System folder? If so, what am I doing wrong?

---

<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:** [April 18, 2017, 7:34pm UTC](https://forum.inductiveautomation.com/t/expression-tag-referencing-system-tags/14075/2 "2017-04-18T19:34:07Z")

</div>

From the error message, it would seem the `hasRole()` expression expects you to pass it a username and usersource as well as the role name.

---

<div class="post-metadata">

**Author:** ![Jim\_Jensen](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jim_jensen/32/3317_2.png) [@Jim\_Jensen](https://forum.inductiveautomation.com/u/Jim_Jensen)\
**Post date:** [April 18, 2017, 7:41pm UTC](https://forum.inductiveautomation.com/t/expression-tag-referencing-system-tags/14075/3 "2017-04-18T19:41:56Z")

</div>

I tried the following with success:

```auto
hasRole("Administrator", "MyName", "dbauth")

```

but the following gives me a type mismatch error on argument 1:

```auto
hasRole("Administrator", {[System]Client/User/Username}, "dbauth")

```

I didn’t want to hard code the user name into the expression so would like to use the system tag instead but that still doesn’t work.

---

<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:** [April 18, 2017, 7:44pm UTC](https://forum.inductiveautomation.com/t/expression-tag-referencing-system-tags/14075/4 "2017-04-18T19:44:12Z")

</div>

Is the tag you’re creating also a client tag? You can’t access `{[System]Client/User/Username}` otherwise.

---

<div class="post-metadata">

**Author:** ![Jim\_Jensen](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jim_jensen/32/3317_2.png) [@Jim\_Jensen](https://forum.inductiveautomation.com/u/Jim_Jensen)\
**Post date:** [April 18, 2017, 7:51pm UTC](https://forum.inductiveautomation.com/t/expression-tag-referencing-system-tags/14075/5 "2017-04-18T19:51:31Z")

</div>

I just created a Client tag containing expression "hasRole(“Administrator”) and it works fine. Why can’t an expression tag located in the project’s default tag provider access [System] tags? I can bind custom properties to those without any issues.

---

<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:** [April 18, 2017, 8:05pm UTC](https://forum.inductiveautomation.com/t/expression-tag-referencing-system-tags/14075/6 "2017-04-18T20:05:10Z")

</div>

> [@Jim\_Jensen](#):
>
> Why can't an expression tag located in the project's default tag provider access [System] tags? I can bind custom properties to those without any issues.

Client system tags, just like the client tag you created, exist only in the running client, with each client instance having its own tags with their own values.

It sounds like you were initially trying to create a regular, gateway-scoped, expression tag. There's no access to client system tags because there's no client associated with anything running on the gateway.

---

<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:** [April 18, 2017, 8:09pm UTC](https://forum.inductiveautomation.com/t/expression-tag-referencing-system-tags/14075/7 "2017-04-18T20:09:34Z")

</div>

Docs explain it better than I can: [https://docs.inductiveautomation.com:8443/display/DOC79/System,+Client,+and+Diagnostic+Tags](https://docs.inductiveautomation.com:8443/display/DOC79/System,+Client,+and+Diagnostic+Tags)

---

<div class="post-metadata">

**Author:** ![Jim\_Jensen](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jim_jensen/32/3317_2.png) [@Jim\_Jensen](https://forum.inductiveautomation.com/u/Jim_Jensen)\
**Post date:** [April 18, 2017, 8:35pm UTC](https://forum.inductiveautomation.com/t/expression-tag-referencing-system-tags/14075/8 "2017-04-18T20:35:42Z")

</div>

Thanks Kevin!

Yep, that’s what I was trying to do. It’s easy to forget that the tags contained in the realtime tag providers are gateway-scoped and not client-scoped.
