Skip to Content
0
Nov 02, 2020 at 10:46 AM

Dynamic Property access in SAP Workflow Service (neo)

83 Views

Hi all,
is it possible to dynamically access object properties in a script task in SAP Workflow Service (Neo)?

Lets assume the following JSON Context for the workflow instance

{ 
  "myObject":{}
}

And I like to create a new property for that object, whereas the name of the property needs to be dynamic. In pure JS I would do something like Object[varsSomeProperty].

var sMyProperty = "SomeProperty";
myObject[sMyProperty] = {};

When I try to do this in the Workflow Service I get the following error:

TypeError: [object ContextObject] is not an Object in <eval> at line number 17