Forum Discussion
aspanda
6 years agoNew Contributor II
Thanks for the details.The B object key that we are trying to find inside object A is a dynamic value that is stored inside another variable. how can we replicate that variable in above expression instead of directly hard coding B.
For Ex.
value= B/C/D/E
how can we look up for B/C/D/E using value variable.
- tstack6 years agoFormer Employee
You can use bracket notation to do a lookup based on the value of an expression:
$A[$keyToLookup]
So, if
$keyToLookup
contained “B”, the above expression would drill down into the “A” object and get the value of the property named “B” .