Hi developers!
In a method I need to return a result as a dynamic object aka JSON Object. And here is my logic:
Classmethod Planets() as%DynamicObject {
set val1="Jupiter"
set val2="Mars"// this doesn't work! cannot compile
return {"value1":val1, "value2":val2}
}So I need to do the following:
Classmethod Planets() as%DynamicObject {
set val1="Jupiter"
set val2="Mars"
set result={}
set result.value1=val1
set result.value2=val2
return result
}The second case works. Maybe I'm preparing the Dynamic Object in the wrong way? Can we just use variables inside JSON?
(3).jpg)


(2).jpg)

