# Cannot concatenate expression

**URL:** <https://forum.inductiveautomation.com/t/cannot-concatenate-expression/53140>\
**Category:** General Discussion\
**Created:** [November 16, 2021, 6:11pm UTC](https://forum.inductiveautomation.com/t/cannot-concatenate-expression/53140 "2021-11-16T18:11:54Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![mbrown1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mbrown1/32/27786_2.png) [@mbrown1](https://forum.inductiveautomation.com/u/mbrown1)\
**Post date:** [November 16, 2021, 6:11pm UTC](https://forum.inductiveautomation.com/t/cannot-concatenate-expression/53140/1 "2021-11-16T18:11:54Z")

</div>

I have the following expression.  
[MySql\_Connection]  
(“sensor”+SensorValue)  
/reading

SensorValue is a parameter I am trying to combine with “sensor” so that as the SensorValue Changes, “sensor” becomes "sensor1, sensor2, etc…).  
What the hell am I doing wrong. I have tried every type of syntax I can think of.

---

<div class="post-metadata">

**Author:** ![Paul.Scott](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul.scott/32/4578_2.png) [@Paul.Scott](https://forum.inductiveautomation.com/u/Paul.Scott)\
**Post date:** [November 16, 2021, 6:17pm UTC](https://forum.inductiveautomation.com/t/cannot-concatenate-expression/53140/2 "2021-11-16T18:17:18Z")

</div>

I’m making some assumptions here, but maybe something like

```auto
"[MySql_Connection]sensor" + toStr(SensorValue) + "/reading"

```

---

<div class="post-metadata">

**Author:** ![mbrown1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mbrown1/32/27786_2.png) [@mbrown1](https://forum.inductiveautomation.com/u/mbrown1)\
**Post date:** [November 16, 2021, 8:26pm UTC](https://forum.inductiveautomation.com/t/cannot-concatenate-expression/53140/3 "2021-11-16T20:26:28Z")

</div>

Did not work. This Tag Path is going into an easy chart for one of the pens. I thought the below would work but it does not.  
“[MySql\_Connection]sensor” + {Root Container.SensorValue} + “/reading”

If i use “[MySql\_Connection]sensor1/reading” then sensor1 comes in fine. The SSensorValue I am referencing shows up in the root container properties and is being used on the same screen for other tags, so I believe that is correct. I am pretty sure I have a syntax issue, but i have spent days trying to fix it.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [November 16, 2021, 8:52pm UTC](https://forum.inductiveautomation.com/t/cannot-concatenate-expression/53140/4 "2021-11-16T20:52:01Z")

</div>

> [@Indirect History Tags in Easy Chart](https://forum.inductiveautomation.com/t/indirect-history-tags-in-easy-chart/3045/2):
>
> Yes, it can be done. All you need to do is bind the Tag Pens dataset property of the Easy Chart to a cell update binding. The cell update binding allows you to dynamically change a cells values in a dataset. If you look at the Tag Pens dataset you will see that the second column is the tag path. In the cell update binding select the tag path cell you want to change and press the green + button to add it below. Select the added record and set the value to whatever path you want. To use a property…

---

<div class="post-metadata">

**Author:** ![mbrown1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mbrown1/32/27786_2.png) [@mbrown1](https://forum.inductiveautomation.com/u/mbrown1)\
**Post date:** [November 17, 2021, 1:07pm UTC](https://forum.inductiveautomation.com/t/cannot-concatenate-expression/53140/5 "2021-11-17T13:07:54Z")

</div>

Sorry, but you lost me with your directions.  
This is what I have.

on the easy chart customizer, I have a pen in the “Tag History Pens” whose Name is “Reading”.

The exact Tag path text is [MySql\_Connection]{“sensor” + SensorValue}/reading

SensorValue is a custom Property that changes depending on which popup I select to get to the easy chart screen.  
When I use the below tag it does work.  
[MySql\_Connection]sensor1/reading

I need to replace the “1” with the SensorValue value, which is an integer.

---

<div class="post-metadata">

**Author:** ![leonardo.godoi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/leonardo.godoi/32/27178_2.png) [@leonardo.godoi](https://forum.inductiveautomation.com/u/leonardo.godoi)\
**Post date:** [November 17, 2021, 1:25pm UTC](https://forum.inductiveautomation.com/t/cannot-concatenate-expression/53140/7 "2021-11-17T13:25:31Z")

</div>

And how exatcly is your custom property text being sent to your Tag Path property on the Easy Chart? You’re using a cell update binding or are you doing something like this?

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/a/1a609576280129d2c2d4aa727c353a4b34fca3e7.png)

---

<div class="post-metadata">

**Author:** ![mbrown1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mbrown1/32/27786_2.png) [@mbrown1](https://forum.inductiveautomation.com/u/mbrown1)\
**Post date:** [November 17, 2021, 1:43pm UTC](https://forum.inductiveautomation.com/t/cannot-concatenate-expression/53140/8 "2021-11-17T13:43:12Z")

</div>

Exactly as you are showing it.

---

<div class="post-metadata">

**Author:** ![leonardo.godoi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/leonardo.godoi/32/27178_2.png) [@leonardo.godoi](https://forum.inductiveautomation.com/u/leonardo.godoi)\
**Post date:** [November 17, 2021, 1:55pm UTC](https://forum.inductiveautomation.com/t/cannot-concatenate-expression/53140/9 "2021-11-17T13:55:45Z")

</div>

I might be wrong, but i don’t think you can use expressions there, can you try the following:

1. Create another custom property, let’s call it “myTagPath” and set it as a string type.

2. Make an expression binding at myTagPath with the expression @Paul.Scott provided but make sure to substitute “(SensorValue)” with the correct path to this value, you’ll know you’re on the right path if the value on the string result after you click OK matches "[MySql\_Connection]sensor1/reading”

3. At the EasyChart’s properties under Chart Configuration create a cell update binding for the Tag Pens dataset that modifies the TAG\_PATH column with myTagPath’s value  
Should look something like this:

---

<div class="post-metadata">

**Author:** ![mbrown1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mbrown1/32/27786_2.png) [@mbrown1](https://forum.inductiveautomation.com/u/mbrown1)\
**Post date:** [November 17, 2021, 3:22pm UTC](https://forum.inductiveautomation.com/t/cannot-concatenate-expression/53140/10 "2021-11-17T15:22:36Z")

</div>

I created a custom property and I have it showing the correct text for the tag, but I cannot find the “Chart configuration” in the properties of the easy chart. I would think the property would go into the “edit Pen” window.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [November 17, 2021, 4:07pm UTC](https://forum.inductiveautomation.com/t/cannot-concatenate-expression/53140/11 "2021-11-17T16:07:27Z")

</div>

Use a Cell Update binding on the ‘Tag Pens’ Dataset

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/5/25fa4eeaa86d763871d420f607438a0c27633538.png)  

[https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/9/29311ac225775b18bb0c53b27f7cf16c1cd2d952.mp4](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/9/29311ac225775b18bb0c53b27f7cf16c1cd2d952.mp4)

---

<div class="post-metadata">

**Author:** ![leonardo.godoi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/leonardo.godoi/32/27178_2.png) [@leonardo.godoi](https://forum.inductiveautomation.com/u/leonardo.godoi)\
**Post date:** [November 17, 2021, 4:08pm UTC](https://forum.inductiveautomation.com/t/cannot-concatenate-expression/53140/12 "2021-11-17T16:08:16Z")

</div>

It should appear right at the bottom, but make sure that your filter(highlighted at the top) is set to All

 ![Inkedjava_kmAvwxe7bX_LI](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/9/99bb51f320b54909ab87da2ebd7440cc35a0211b.jpeg)

---

<div class="post-metadata">

**Author:** ![mbrown1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mbrown1/32/27786_2.png) [@mbrown1](https://forum.inductiveautomation.com/u/mbrown1)\
**Post date:** [November 17, 2021, 5:51pm UTC](https://forum.inductiveautomation.com/t/cannot-concatenate-expression/53140/13 "2021-11-17T17:51:57Z")

</div>

Thank all of your guys very much. I finally got it. Leonardo pointed me to the Dataset, and that is what I needed. It seems like way too much work just to make a damn tag work properly.

thank you, again.

---

<div class="post-metadata">

**Author:** ![leonardo.godoi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/leonardo.godoi/32/27178_2.png) [@leonardo.godoi](https://forum.inductiveautomation.com/u/leonardo.godoi)\
**Post date:** [November 17, 2021, 6:17pm UTC](https://forum.inductiveautomation.com/t/cannot-concatenate-expression/53140/14 "2021-11-17T18:17:29Z")

</div>

> [@mbrown1](#):
>
> It seems like way too much work just to make a damn tag work properly

Well, that's on me, after reading carefully the post @JordanCClark cited, the whole process can be simplified by deleting the custom property and writing the expression directly at the "value" field on the Cell Update Binding like this:

```auto
[MySql_Connection]sensor{Root Container.SensorValue}/reading

```

Note that this time you wont have to use " since the field will already convert to a string and concatenate after solving your property reference, so by giving it the correct adress for your sensor value it'll look something like this:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/5/3576287a3a045e9434e4abbbdceb0abc613e76a9.png)

Also Note that it works with tag references too.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [November 17, 2021, 6:40pm UTC](https://forum.inductiveautomation.com/t/cannot-concatenate-expression/53140/15 "2021-11-17T18:40:01Z")

</div>

> [@mbrown1](#):
>
> It seems like way too much work just to make a damn tag work properly.

I agree. It's also a reason I don't bother using the historian.

---

<div class="post-metadata">

**Author:** ![mbrown1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mbrown1/32/27786_2.png) [@mbrown1](https://forum.inductiveautomation.com/u/mbrown1)\
**Post date:** [November 17, 2021, 6:49pm UTC](https://forum.inductiveautomation.com/t/cannot-concatenate-expression/53140/16 "2021-11-17T18:49:50Z")

</div>

Thanks for the extra info. I will keep it in mind for future reference.  
Thanks again for the help.

---

<div class="post-metadata">

**Author:** ![mbrown1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mbrown1/32/27786_2.png) [@mbrown1](https://forum.inductiveautomation.com/u/mbrown1)\
**Post date:** [November 18, 2021, 6:42pm UTC](https://forum.inductiveautomation.com/t/cannot-concatenate-expression/53140/17 "2021-11-18T18:42:05Z")

</div>

I am in need of one more piece of assistance.  
I got the one pen working with this:  
[default]sensor1/reading

I have two pens that are supposed to read the alarm setpoints. I have this:  
[default]sensor1/Reading/Alarms/High Alarm.SetpointA  
[default]sensor1/Reading/Alarms/Low Alarm.SetpointA

Thyey will not work. any idea?

---

<div class="post-metadata">

**Author:** ![leonardo.godoi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/leonardo.godoi/32/27178_2.png) [@leonardo.godoi](https://forum.inductiveautomation.com/u/leonardo.godoi)\
**Post date:** [November 18, 2021, 7:05pm UTC](https://forum.inductiveautomation.com/t/cannot-concatenate-expression/53140/18 "2021-11-18T19:05:59Z")

</div>

Those look like adresses to point directly to the alarm’s setpoint, being “Alarms” the name of your tag and High Alarm and Low Alarm the names of two different alarms configured there, is that correct?

If so, maybe it doesn’t work because they’re not historical and in that case you can add two calculated pens with the Constant function using the easy chart customizer and then the process will be the same as with your tag history pens, but this time your dataset will be called “Calculated Pens” and the column you need to modify is called “FUNCTION\_PARAM” and instead of a properety or an expression, you use the same tag path you provided above.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/9/99a8af9cab7d39ff15a83f9335543a2a0e31a946.png)
