# \[BUG\] Binding Integer to Data Point from Data Set Created from split()

**URL:** <https://forum.inductiveautomation.com/t/bug-binding-integer-to-data-point-from-data-set-created-from-split/58022>\
**Category:** Ignition\
**Tags:** ignition80\
**Created:** [April 4, 2022, 11:37pm UTC](https://forum.inductiveautomation.com/t/bug-binding-integer-to-data-point-from-data-set-created-from-split/58022 "2022-04-04T23:37:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [April 4, 2022, 11:37pm UTC](https://forum.inductiveautomation.com/t/bug-binding-integer-to-data-point-from-data-set-created-from-split/58022/1 "2022-04-04T23:37:04Z")

</div>

Running into a bug binding a data point from a data set that was created by the `split()` function in an expression to a property. Here’s my setup:

Template named `test` with a single rectangle component.  
String tag with value of `255,0,0` bound to internal property `svgColor`  
Rectangle component named `Rectangle`

String properties on the rectangle of `color_R`, `color_G`, and `color_B` that are derived from from the internal `svgColor` property using `toInteger(split({test.svgColor},",")[0,0])` / `[1,0]` / `[2,0]` expressions, respectively.

Initially, all of the bindings seem to work. However, once I save, close, and reopen the template I’m getting some errors with `color_G` and `color_B`. They throw this error:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/1/51f65fdcca73e46e10eaa5d2487df619128dd15c.png)  
(but not `color_R`?)

Checking the dataset manually by making a temporary dataset property and binding to an expression of `split({[default]svgColor},",")`, I can see that I get 3 rows, 1 column.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/7/1732e151ebb4996b2c1bf114abd072e8addbbc23.png)  
It seems like the bindings still work, despite the errors.

What’s very odd, is if I remove the binding of the tag to `svgColor` (and leave the rest of the bindings the same) I no longer get the errors.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 4, 2022, 11:41pm UTC](https://forum.inductiveautomation.com/t/bug-binding-integer-to-data-point-from-data-set-created-from-split/58022/2 "2022-04-04T23:41:55Z")

</div>

Tag bindings start up with a null or -1. That doesn’t split, so you don’t get the 2nd and 3rd elements at startup. Wrap in the `try()` expression to mitigate.

---

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [April 8, 2022, 1:55pm UTC](https://forum.inductiveautomation.com/t/bug-binding-integer-to-data-point-from-data-set-created-from-split/58022/3 "2022-04-08T13:55:33Z")

</div>

Wrap the whole thing, or just the split?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 8, 2022, 4:40pm UTC](https://forum.inductiveautomation.com/t/bug-binding-integer-to-data-point-from-data-set-created-from-split/58022/4 "2022-04-08T16:40:38Z")

</div>

Wrap the individual expressions that are trying to pull non-existent elements out of the dataset.
