0 / 0
Syntax for properties

Syntax for properties

You can set properties using the following syntax:

OBJECT.setPropertyValue(PROPERTY, VALUE)

or:

OBJECT.setKeyedPropertyValue(PROPERTY, KEY, VALUE)

You can retrieve the value of properties using the following syntax:

VARIABLE = OBJECT.getPropertyValue(PROPERTY)

or:

VARIABLE = OBJECT.getKeyedPropertyValue(PROPERTY, KEY)

where OBJECT is a node or output, PROPERTY is the name of the node property that your expression refers to, and KEY is the key value for keyed properties. For example, the following syntax finds the Filter node and then sets the default to include all fields and filter the Age field from downstream data:

filternode = modeler.script.stream().findByType("filter", None)
filternode.setPropertyValue("default_include", True)
filternode.setKeyedPropertyValue("include", "Age", False)

All nodes used in SPSS Modeler can be located using the flow function findByType(TYPE, LABEL). At least one of TYPE or LABEL must be specified.

Generative AI search and answer
These answers are generated by a large language model in watsonx.ai based on content from the product documentation. Learn more