# Component Name Invalid

**URL:** <https://forum.inductiveautomation.com/t/component-name-invalid/5775>\
**Category:** Ignition\
**Created:** [January 31, 2013, 6:59pm UTC](https://forum.inductiveautomation.com/t/component-name-invalid/5775 "2013-01-31T18:59:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![weertske](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/weertske/32/3353_2.png) [@weertske](https://forum.inductiveautomation.com/u/weertske)\
**Post date:** [January 31, 2013, 6:59pm UTC](https://forum.inductiveautomation.com/t/component-name-invalid/5775/1 "2013-01-31T18:59:19Z")

</div>

I am setting up a new project extensively using templates and UDTs. As I place template instances on a window, I name them by binding their “Name” property to a tag that contains the name for this instance.

example: pump UDT contains 2 tags: running (opc-bool) and name (memory-string). I create a tag from this data type called pump1 and assign the name pump1 to the underlying name tag. I create a template of a pump that displays the running status and the pump name. When I place an instance of this template on a window and set up the paths it all works fine. As a last step I name this template instance by binding its “Name” property to pump1/name. (this is what causes the problem.)

All is good until I start up a client. The first time this window is displayed, it throws the following error:

![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/b/b82b405fb53df232941ece2f292c363d898d98c1.jpeg)

After I clear the error, all is good until I start the client again, when the same thing happens. Why is this error occuring and if I can’t stop it, what can I do to keep it from displaying?

---

<div class="post-metadata">

**Author:** ![Travis.Cox](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@Travis.Cox](https://forum.inductiveautomation.com/u/Travis.Cox)\
**Post date:** [January 31, 2013, 7:42pm UTC](https://forum.inductiveautomation.com/t/component-name-invalid/5775/2 "2013-01-31T19:42:47Z")

</div>

You are getting the error because right before the value that is passed in updates the binding returns a -1 value. You would have to catch that value and return something else since the name cannot have a - sign. It really isn’t recommended to bind the name property.

---

<div class="post-metadata">

**Author:** ![weertske](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/weertske/32/3353_2.png) [@weertske](https://forum.inductiveautomation.com/u/weertske)\
**Post date:** [February 1, 2013, 5:28pm UTC](https://forum.inductiveautomation.com/t/component-name-invalid/5775/3 "2013-02-01T17:28:35Z")

</div>

I really like the organization that linked names brings so I am not ready to give that up yet. Could you help me with the code to catch the error?

---

<div class="post-metadata">

**Author:** ![Robert](https://avatars.discourse-cdn.com/v4/letter/r/e95f7d/32.png) [@Robert](https://forum.inductiveautomation.com/u/Robert)\
**Post date:** [February 1, 2013, 7:50pm UTC](https://forum.inductiveautomation.com/t/component-name-invalid/5775/4 "2013-02-01T19:50:50Z")

</div>

Here is the code I use to strip '-'s from tag names. This goes in the Name binding as an expression.

```auto
replace({Root Container.Path To.Component Name.Bound Tag},'-','')
```

---

<div class="post-metadata">

**Author:** ![weertske](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/weertske/32/3353_2.png) [@weertske](https://forum.inductiveautomation.com/u/weertske)\
**Post date:** [February 2, 2013, 5:02pm UTC](https://forum.inductiveautomation.com/t/component-name-invalid/5775/5 "2013-02-02T17:02:27Z")

</div>

Robert,  
The replace function works like a charm. Thank you.
