Lightning: Expression to get dynamic field on Object/SObject

In VF it is possible to do like:

<apex:outputField value="{!target[dynProperty]}"/>

Which expression can be used to do similar thing inside lightning component (not inside lightning js controller)? Doing like this


results in error:

Failed to save undefined: expecting a positive integer, found ‘dynProperty’ at column 10 of expression:[dynProperty]: Source

Are there any ideas how to do this inside component (not js controller)?


The expression syntax does not support it.

You can use index array referencing, but not what you are doing here.

{![3]} – Okay

{!} – Okay

What you suggested, no joy.

Source : Link , Question Author : Natallia , Answer Author : Ratan Paul

Leave a Comment