# Tag path concatenation

**URL:** <https://forum.inductiveautomation.com/t/tag-path-concatenation/7071>\
**Category:** General Discussion\
**Created:** [August 17, 2013, 2:39am UTC](https://forum.inductiveautomation.com/t/tag-path-concatenation/7071 "2013-08-17T02:39:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sir\_Hacksalot](https://avatars.discourse-cdn.com/v4/letter/s/46a35a/32.png) [@Sir\_Hacksalot](https://forum.inductiveautomation.com/u/Sir_Hacksalot)\
**Post date:** [August 17, 2013, 2:39am UTC](https://forum.inductiveautomation.com/t/tag-path-concatenation/7071/1 "2013-08-17T02:39:49Z")

</div>

system.tag.write(’[Client]input/’ + section + ‘\_value’, value)

whereas ‘section’ is a string variable.

Fails with:

TypeError: cannot concatenate ‘str’ and ‘com.inductiveautomation.ignition.common.sqltags.BasicTagValue’ objects

as this is being used in a a parameterized window, this would save me a complex switch style case selection and maintaining a hard coded reference to sections in this window.

I assumed this would work because the quoted string appears to be, well, a string… 😒

---

<div class="post-metadata">

**Author:** ![Sir\_Hacksalot](https://avatars.discourse-cdn.com/v4/letter/s/46a35a/32.png) [@Sir\_Hacksalot](https://forum.inductiveautomation.com/u/Sir_Hacksalot)\
**Post date:** [August 17, 2013, 7:09pm UTC](https://forum.inductiveautomation.com/t/tag-path-concatenation/7071/2 "2013-08-17T19:09:58Z")

</div>

I solved this, it was created by me.

I had assumed that the return of a tag.read operation on a string tag would be the string value.

The BasicTagValue was however an object that contained the quality and the value.  
I had assumed the error message was telling me that the BasicTagValue was what I was trying to combine with my string path variable, instead it was telling me that the string tag path could not be combined with my retrieved value.

So when I cast my tag return to string I was actually left with the string ‘[,]’

using tag.read().value retrieved the string only portion, and then the concatenated path worked as expected…

All fixed now, just a learning experience.

---

<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:** [August 18, 2013, 1:45am UTC](https://forum.inductiveautomation.com/t/tag-path-concatenation/7071/3 "2013-08-18T01:45:30Z")

</div>

[quote=“Sir Hacksalot”]  
I had assumed that the return of a tag.read operation on a string tag would be the string value.

The BasicTagValue was however an object that contained the quality and the value.[/quote]

This mistake is so common that it should be some kind of initiation into the Ignition user brotherhood 😉

Glad you figured it out.
