I know this must be easy to do, but I just can’t find or figure out the syntax. I’m looking for an equivalent function or method in perspective to build a dynamic props path so that I can get the value through scripting.
This is the hard coded props path I want
self.getSibling(“Table”).props.selection.data[0].OrderID
I want to be able to use a variable in the path.
I thought this would work but it doesn’t.
self.getSibling(“Table”).props.selection.data[0][SomeVariable]
Is there a way to construct the path as a string and then get the value of the property such as
self.getSibling(“Table”).getValue(“props.selection.data[0].”+ SomeVariable) ?
In python, bracket syntax only works with subscript lookup in lists/arrays, or key lookup in dictionaries. The dot operator only accepts a fixed string in the code for the lookup of properties.
One of the Devs recently modified the wrapper objects to behave more like Python datatypes, so you access them (for the most part) as you would a python datatype. This prevents users from encountering instances where they get an Array (or ArrayList?) object but can’t iterate through it with a python for loop because it isn’t a list, or instances where an ObjectWrapper had to be used as a Java object. You can thank @PGriffith.