Hello D., M., and other,
No need of `%eval()`, just use square bracket, as:
@startuml
!$foo = { "company": "Skynet", "employees" : [
{"name" : "alice", "salary": 100 },
{"name" : "bob", "salary": 50} ]
}
start
!$attribute1="name"
!$attribute2="salary"
:The salary of <u>$foo.employees[0][$attribute1]</u> is <u>$foo.employees[0][$attribute2]</u>;
@enduml
See also, my similar question, from last year:
- https://forum.plantuml.net/11143/data-structures-json-access-json-data-directly-redirection
This functionality is not well documented; I just update the doc. now.
If that can help,
Regards,
Th.