Task Action: Set Property

The get action allows to set the value(s) of a node property. The property can be of any type, a relation, a map or a primitive Type. See also get to discover how to get the value of a node property using Tasks.

This action should only be used after a task returning node(s) as result.

The use of setProperty doesn't impact the current result, thus several setProperty can be chained.

setProperty requires 3 parameters:

  • name of the property
  • type of the property
  • value to set (as String) or name of the variable containing the value

Property Type

Types can be found in org.mwg.Type, 5 different types can be used

  • BOOL
  • LONG
  • INT

Therefore, the following expression:


Will create a node with the following properties:

  • name = mynode
  • level = 1
  • restriction = true

Note that it is possible to apply some operation to variable directly within the third parameters:

.setProperty("name", Type.INT, "{{= myvar + 1}}")

Will print the following result:


Multiple Nodes set

When several nodes are present in the result, the set task is apply to all of them. Thus, when applying the following task to the running example


a property locked will be added to all the rooms with an initial value of true.

results matching ""

    No results matching ""