Skip to main content

Properties

The Property class provides access to global and local properties within scripts. Properties let you store and retrieve values across nodes during workflow execution.

For a guide on where and how to define properties in the Workflow Builder, see Properties.


Property Class

PropertyDescription
Property.localAccess the local PropEnvironment for the current node.

PropEnvironment Methods

MethodReturn TypeDescription
set(propertyId, value)voidSets a property value.
get(propertyId)anyRetrieves a property value.
inc(propertyId)IntegerIncrements a numeric property and returns the new value.
dec(propertyId)IntegerDecrements a numeric property and returns the new value.
counter(propertyId)IntegerReturns the current value without modifying it.

Example

// Set a local property
Property.local.set("myProperty", 42);

// Read it back
var value = Property.local.get("myProperty"); // 42

// Increment
var next = Property.local.inc("myProperty"); // 43

Global Properties

Global properties are defined in the Workflow Settings dialog under the Properties tab. They are evaluated at the start of each iteration and are accessible from any node in the workflow.

To read a global property, use its ID directly:

// Preferred approach — use the property ID directly
GLOBAL1

// Alternative (deprecated)
Property.global.get("GLOBAL1")
note

Property.global.set() is deprecated. Define global properties in Workflow Settings instead.


Local Properties

Local properties are defined per node using the Add Property button under the node's Properties tab. They are accessible only within the current node and its successors in the same iteration.

Property.local.set("localProperty1", "test value");

// Read in this node or any downstream node
var value = Property.local.get("localProperty1");

Example: Extract Max Value

This script reads tabular data from the previous node, sorts by column 6 in descending order, and stores the highest value in a local property.

var table = NodeInputReader.inputAsDataFrame(0);

// Sort by column 6, descending
table = table.sortOn(-6);

// Get the max value (first row after sort)
var maxValue = table.column(6).get(0);

Property.local.set("MAXVALUE", maxValue);