I have read the previous topics on calling variables, but they acually dont solve the issue. I know it is possible to call a child variable, but there seems to be no solution about a parent one.
How do I…
How do I call a parent variable. Not a child one. If the feature does not exist, how do I ask it to be added, because I think it could be super usefull.
What is the expected result
For the sake of an extension, the most user-friendly experience would be that the user picks from a list of predefined values (eg. red, green, blue) that correlate with some variable. However, unless the variable is a child (eg. Hat.red, Hat.green, Hat.blue) it is impossible to call it.
What is the actual result
If I have a variable string “style” that stores the desired values (eg. red, green, blue, as child variables from Hat) I can later call for Hat[style]: and it gives me whatever value is stored in Hat.red, Hat.green or Hat.blue, depending on the string value. That is good.
But, if I have a variable string “stylish” that stores the desired values (eg. Red, Green, Blue as parent variables without childs) I cannot later call for [stylish] and obtain whatever value is stored in red, green or blue, depending on the string value. Of course I could call directly for the variables instead… but I dont know which variable is going to be choosen.
So instead of one command (Change the variable X set to [stylish])
I have to use three conditions
If stylish=“red”, then change the variable X set to Red.
If stylish=“blue”, then change the variable X set to Blue.
If stylish=“green”, then change the variable X set to Green.
Now imagine if, instead of three, there are 10, a hundered on an indefinite number of options? It is not that the problem does not have a work around, but
- I want to know if I am missing or missunderstanding something.
- Being able to call for variables, including parents, would be an improvement and, hopefully help scalability and performance in extensions.