# Property from dataset

**URL:** <https://forum.inductiveautomation.com/t/property-from-dataset/100280>\
**Category:** Ignition\
**Tags:** database, ignition81, vision\
**Created:** [December 27, 2024, 8:48pm UTC](https://forum.inductiveautomation.com/t/property-from-dataset/100280 "2024-12-27T20:48:13Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [December 28, 2024, 3:08am UTC](https://forum.inductiveautomation.com/t/property-from-dataset/100280/4 "2024-12-28T03:08:08Z")

</div>

> [@Nicole\_McCormack](#):
>
> `:myCurrStepNum`

Is this the problem? It's initially using the previous step number in the where condition of the query?

Perhaps save the window with the default value in the text editor, and use scripting to populate the data instead of a binding.

**Example:**

```python
# Updates the value only when the step number changes
# Assumes there is a custom property on the text field called myCurrStepNum,
# ...and that the step num is updated automatically in some way
if event.propertyName == 'myCurrStepNum' and event.newValue is not None:
	query = 'SELECT safety FROM tasks WHERE stepnumber = ?'
	event.source.text = system.db.runScalarPrepQuery(query, [event.newValue], 'NameOFDatabase')

```

---

_[View the full topic](https://forum.inductiveautomation.com/t/property-from-dataset/100280)._
