# Using an expression to check a dataset contains data

**URL:** <https://forum.inductiveautomation.com/t/using-an-expression-to-check-a-dataset-contains-data/1089>\
**Category:** Archived Topics\
**Created:** [April 16, 2009, 1:51pm UTC](https://forum.inductiveautomation.com/t/using-an-expression-to-check-a-dataset-contains-data/1089 "2009-04-16T13:51:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![AlThePal](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/althepal/32/3603_2.png) [@AlThePal](https://forum.inductiveautomation.com/u/AlThePal)\
**Post date:** [April 16, 2009, 1:51pm UTC](https://forum.inductiveautomation.com/t/using-an-expression-to-check-a-dataset-contains-data/1089/1 "2009-04-16T13:51:21Z")

</div>

Is it possible using the expression language to check whether a dataset contains any values? Specifically, I want to only enable a button if a dataset actually contains data.

Al

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [April 16, 2009, 3:31pm UTC](https://forum.inductiveautomation.com/t/using-an-expression-to-check-a-dataset-contains-data/1089/2 "2009-04-16T15:31:14Z")

</div>

You should just be able to bind the enabled property of the button to something like:

```auto
len({Path.To.My.Dataset}) > 0
```

---

<div class="post-metadata">

**Author:** ![AlThePal](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/althepal/32/3603_2.png) [@AlThePal](https://forum.inductiveautomation.com/u/AlThePal)\
**Post date:** [April 16, 2009, 4:21pm UTC](https://forum.inductiveautomation.com/t/using-an-expression-to-check-a-dataset-contains-data/1089/3 "2009-04-16T16:21:29Z")

</div>

Thanks Carl, that works splendidly.

Al
