Using a field value as a variable for reference field in expression


I have two types:

Parent {
  rfVals: [double]

Child {
  parent: Parent
  fieldOfInterest: string
  parentValues: [double] calc "parent[fieldOfInterest]"

If my Child.fieldOfInterest is "rfVals" for instance, how would I get this sort of calc to work?

This returns Error: wrapped IndexOutOfBoundsException: Index: 0


What you are basically trying to do is parent.fieldName. Since the fieldName is dynamic you want an api like fieldValue(obj, name)

Currently this api doesn’t exist but in v7.9 you can have any custom expressions added at the application level even if its not available as a part of the platform.


Thanks, @rohit.sureka!