Newbie question here… how do I get / set these values in this (sub)Struct to variables?
In the end, I want to have them set to variables like:
<cfset CategoryID = StructVar>
<cfset CategoryName = StructVar>
Thanks!
Newbie question here… how do I get / set these values in this (sub)Struct to variables?
In the end, I want to have them set to variables like:
<cfset CategoryID = StructVar>
<cfset CategoryName = StructVar>
Thanks!
Could you try with this simple & static example,
<cfscript>
arr = [];
arr[1] = {"position":"prof","category":
{"id":"1","name":"jhon"},"age":23};
dump(arr);
categoryname = arr[1].category.name;
categoryid = arr[1].category.id;
arr[1].category.name = "joe";
dump(arr);
dump(categoryname);
dump(categoryid);
</cfscript>
Cool! Thanks.
Seeing how you did that, I actually ended up using the following:
<cfset CategoryID =i.category.id>
<cfset CategoryName =i.category.name>
Since my CFLOOP over this array is:
<cfloop array="#deserialized#" index="i">