# Scripting on Custom Properties

**URL:** <https://forum.inductiveautomation.com/t/scripting-on-custom-properties/18135>\
**Category:** Ignition\
**Created:** [May 23, 2018, 1:27pm UTC](https://forum.inductiveautomation.com/t/scripting-on-custom-properties/18135 "2018-05-23T13:27:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rrowe](https://avatars.discourse-cdn.com/v4/letter/r/c57346/32.png) [@rrowe](https://forum.inductiveautomation.com/u/rrowe)\
**Post date:** [May 23, 2018, 1:27pm UTC](https://forum.inductiveautomation.com/t/scripting-on-custom-properties/18135/1 "2018-05-23T13:27:03Z")

</div>

How can I, if possible, pull in custom properties into my scripts?

Here’s what I want to do: I have a custom property whose type is a dataset. I want some way to know if there are zero rows. I didn’t see any ability to do this by creating an expression, so I’m guessing it has to be done with a script. I know how to write scripts on datasets in general, but I’m not sure how to access custom properties in my scripts.

---

<div class="post-metadata">

**Author:** ![ethomason](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ethomason/32/43338_2.png) [@ethomason](https://forum.inductiveautomation.com/u/ethomason)\
**Post date:** [May 23, 2018, 2:02pm UTC](https://forum.inductiveautomation.com/t/scripting-on-custom-properties/18135/2 "2018-05-23T14:02:07Z")

</div>

Here's a simple example using an actionPerformed script of a button located on a root container that has a dataset custom property called testDS :

> myDataSet = event.source.parent.testDS  
> system.gui.messageBox("My Datset has " + str(myDataSet.getRowCount()) + " rows")

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [May 23, 2018, 3:05pm UTC](https://forum.inductiveautomation.com/t/scripting-on-custom-properties/18135/3 "2018-05-23T15:05:23Z")

</div>

Also, you can use the [`len`](https://docs.inductiveautomation.com/display/DOC79/len) expression function on datasets, if you want to continue using expressions.
