# Strange Error When Binding with a tag with dataset value

**URL:** <https://forum.inductiveautomation.com/t/strange-error-when-binding-with-a-tag-with-dataset-value/104810>\
**Category:** Ignition\
**Tags:** ignition81, vision\
**Created:** [April 8, 2025, 1:24am UTC](https://forum.inductiveautomation.com/t/strange-error-when-binding-with-a-tag-with-dataset-value/104810 "2025-04-08T01:24:30Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lion\_Sun](https://avatars.discourse-cdn.com/v4/letter/l/3ab097/32.png) [@Lion\_Sun](https://forum.inductiveautomation.com/u/Lion_Sun)\
**Post date:** [April 8, 2025, 1:24am UTC](https://forum.inductiveautomation.com/t/strange-error-when-binding-with-a-tag-with-dataset-value/104810/1 "2025-04-08T01:24:30Z")

</div>

I have a label, and just simply bind its' text property to a tag with dataset value

the expression binding is something like below, this tag with a Dataset [24R x 4C] value, I just use a specific cell [0,3]. The syntax is right and everything seems ok.

```python
{path_to_my_tag.value}[0,3]

```

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

The strange thing is that, when I close this vision window and reopen it in designer, at the first moment, the designer reports an error as below:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/3/63b08709adfdd61a572f38941635354102d39c10.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/f/1fc1dece4cf076c2e1399bbb5fbf5cd21ce88dea.png)

but the text value is correct displayed in this label. It's quite annoying and I just update the binding expression as below:

```python
try(
	{path_to_my_tag.value}[0,3],
	'error'
)

```

the error message disappears when I close and re-open it, and no 'error' text displayed in this label.

It seems this binding cannot get the value in first moment when open this window, but just after that moment it can get value successfully. Does anyone know the reason for this?

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [April 8, 2025, 6:34am UTC](https://forum.inductiveautomation.com/t/strange-error-when-binding-with-a-tag-with-dataset-value/104810/2 "2025-04-08T06:34:05Z")

</div>

I suspect you’re right and the expression initially tries to subscript a dataset that hasn’t loaded yet.  
Try `{your/tag[0,3]}` instead

---

<div class="post-metadata">

**Author:** ![Lion\_Sun](https://avatars.discourse-cdn.com/v4/letter/l/3ab097/32.png) [@Lion\_Sun](https://forum.inductiveautomation.com/u/Lion_Sun)\
**Post date:** [April 8, 2025, 7:15am UTC](https://forum.inductiveautomation.com/t/strange-error-when-binding-with-a-tag-with-dataset-value/104810/3 "2025-04-08T07:15:29Z")

</div>

Awesome! Your suggestion works. Thank you!

I read the [document](https://docs.inductiveautomation.com/docs/8.1/platform/expression-language-and-syntax#dataset-access), the methods to access the data in dataset when using expression is as below.

```python
Dataset_Expression ["Column_Name"] //Returns the value from the first row at the given column name.
Dataset_Expression [Column_Index] //Returns the value from the given column at the first row.
Dataset_Expression [Row_Index, "Column_Name"] //Returns the value from the given row at the given column name.
Dataset_Expression [Row_Index, Column_Index] //Returns the value from the given row at the given column index.

```

This is the first time I know can use the method as you suggested.

It seems below two methods both workable and it seems the latter one is much better for my case.

```python
{path_to_dataset_tag.value}[Row_index, Column_Index]

{path_to_dataset_tag[Row_index, Column_Index]}

```

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [April 8, 2025, 7:19am UTC](https://forum.inductiveautomation.com/t/strange-error-when-binding-with-a-tag-with-dataset-value/104810/4 "2025-04-08T07:19:54Z")

</div>

I would expect them not to do the same thing.  
The first one would read the full tag, then apply the subscript.  
The second one would only read the specified row/column.

Which explains why the first one raises an error before the tag is read.  
Also, I'd expect the second one to be faster, even if only slightly.

---

<div class="post-metadata">

**Author:** ![Lion\_Sun](https://avatars.discourse-cdn.com/v4/letter/l/3ab097/32.png) [@Lion\_Sun](https://forum.inductiveautomation.com/u/Lion_Sun)\
**Post date:** [April 8, 2025, 7:26am UTC](https://forum.inductiveautomation.com/t/strange-error-when-binding-with-a-tag-with-dataset-value/104810/5 "2025-04-08T07:26:46Z")

</div>

Yes, your explanation is clear and make sense!

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [April 8, 2025, 7:27am UTC](https://forum.inductiveautomation.com/t/strange-error-when-binding-with-a-tag-with-dataset-value/104810/6 "2025-04-08T07:27:56Z")

</div>

One more thing:  
You probably should be using a tag binding, not an expression binding:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/0/f006a63003f5895240ce08b091504a364a59e208.png)

---

<div class="post-metadata">

**Author:** ![Lion\_Sun](https://avatars.discourse-cdn.com/v4/letter/l/3ab097/32.png) [@Lion\_Sun](https://forum.inductiveautomation.com/u/Lion_Sun)\
**Post date:** [April 8, 2025, 7:44am UTC](https://forum.inductiveautomation.com/t/strange-error-when-binding-with-a-tag-with-dataset-value/104810/7 "2025-04-08T07:44:08Z")

</div>

Yes, you are right. If only use a cell value from dataset, use tag binding directly is much easier

For my actual case, I just use expression to apply more logics to that value.

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [April 8, 2025, 8:05am UTC](https://forum.inductiveautomation.com/t/strange-error-when-binding-with-a-tag-with-dataset-value/104810/8 "2025-04-08T08:05:51Z")

</div>

It might still be worth it to have a custom property read that value with a tag binding, then post-process it in the label's binding.  
But wait for someone else's opinion on this, I'm not well versed in this kind of things.
