# Why cannot access the data from a dataset

**URL:** <https://forum.inductiveautomation.com/t/why-cannot-access-the-data-from-a-dataset/62672>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [August 4, 2022, 1:59pm UTC](https://forum.inductiveautomation.com/t/why-cannot-access-the-data-from-a-dataset/62672 "2022-08-04T13:59:21Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jfchicat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jfchicat/32/63831_2.png) [@jfchicat](https://forum.inductiveautomation.com/u/jfchicat)\
**Post date:** [August 4, 2022, 1:59pm UTC](https://forum.inductiveautomation.com/t/why-cannot-access-the-data-from-a-dataset/62672/1 "2022-08-04T13:59:21Z")

</div>

Not sure why I can’t access the value from the first column at the first row with the expression below  
`if({Conveyor.FaultedTime} [1] = none, x, y)`

All I am trying to do is:  
If ConveyorFaultedTime is empty  
execute x  
Else  
execute y

---

<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:** [August 4, 2022, 2:00pm UTC](https://forum.inductiveautomation.com/t/why-cannot-access-the-data-from-a-dataset/62672/2 "2022-08-04T14:00:41Z")

</div>

Subscripts start with zero.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [August 4, 2022, 2:15pm UTC](https://forum.inductiveautomation.com/t/why-cannot-access-the-data-from-a-dataset/62672/3 "2022-08-04T14:15:13Z")

</div>

Apart from Phil’s comment, shouldn’t your expression be  
`if({Conveyor.FaultedTime}[1] = null, x, y)`?

Use ‘null’ in Expression Language. Use ‘None’ (capital N) in Python.

* * *

Tip: use the \</\> code formatting button when posting code. It will indent properly (important for Python) and give syntax highlighting. You can use the 🖉 edit link to fix your post.

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [August 4, 2022, 2:15pm UTC](https://forum.inductiveautomation.com/t/why-cannot-access-the-data-from-a-dataset/62672/4 "2022-08-04T14:15:49Z")

</div>

Also if you want a specific column of a specific row you want two arguments like  
`if({Conveyor.FaultedTime} [0,0] = null, x, y)`  
or  
`if({Conveyor.FaultedTime} [0,'someColumnName'] = null, x, y)`

---

<div class="post-metadata">

**Author:** ![jfchicat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jfchicat/32/63831_2.png) [@jfchicat](https://forum.inductiveautomation.com/u/jfchicat)\
**Post date:** [August 4, 2022, 2:53pm UTC](https://forum.inductiveautomation.com/t/why-cannot-access-the-data-from-a-dataset/62672/5 "2022-08-04T14:53:42Z")

</div>

Thanks all for the replies. Additionally, how can I handle empty rows?

```auto
{Conveyor.FaultedTime} [0,1] = null

```

Does not seem to be working; I get the following error  
“_Error executing expression binding_”

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [August 4, 2022, 2:58pm UTC](https://forum.inductiveautomation.com/t/why-cannot-access-the-data-from-a-dataset/62672/6 "2022-08-04T14:58:29Z")

</div>

1. don’t put any spaces beteween `{Conveyor.FaultedTime} [0,1] `, should look more like `{Conveyor.FaultedTime}[0,1]` Also I highly recommend using the column name for the second arugment - makes it more readable when you have to come back to it (and if you ever end up editing the dataset by adding or removing columns it will still work if its based on the column name).

2. To handle empty rows my preferred method and I think the best practices method imo is to follow the python paradigm of trying first and asking for forgivness second. So maybe two custom properties are your best bet here. One that tries to get the data out if it exists or provides a fallback value if it does not looks like `try({Conveyor.FaultedTime}[0, 1], "FALL BACK VALUE HERE")`. So if there is a zero’th row, you will get it, otherwise you will get whatever the second argument of your try statement is when it doesn’t exist. Then in another custom property check out the value, you can add a case in case its the fallback value if desired, etc.

---

<div class="post-metadata">

**Author:** ![jfchicat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jfchicat/32/63831_2.png) [@jfchicat](https://forum.inductiveautomation.com/u/jfchicat)\
**Post date:** [August 4, 2022, 3:37pm UTC](https://forum.inductiveautomation.com/t/why-cannot-access-the-data-from-a-dataset/62672/7 "2022-08-04T15:37:26Z")

</div>

Thanks for the detailed explanation. It is working now.
