Accessing a dictionary from an array of dictionaries

Jul 31, 2012 at 11:22am

Accessing a dictionary from an array of dictionaries

Here’s an example JSON/dict structure:

{
    "first": {
        "list": [
            {
                "second": "value"
            }
        ]
    }
}

Now my JSON doesn’t look like that, but the example gets to the heart of the matter: get-ing “value”. When I message my dict:

get first::list[0]

I of course receive a pointer to another dictionary. However, when I message my dict:

get first::list[0]::second

I don’t receive the string “value” as anticipated, instead I get nothing at all. So what message am I supposed to return to dict in order to get the string “value”?

#63801
Aug 1, 2012 at 12:08pm

Hi there,

you are right… I get the same behavior.
It seems it is not possible to get values from lists of dictionaries.

You might have found a bug or a limitation of the [dict] object.
I would report it as a bug to the C74 folks and see what they say…

- Luigi

#230087
Sep 25, 2012 at 3:57pm

check my reply here. this may help your situation:

http://cycling74.com/forums/topic.php?id=42681&replies=2#post-204566

#230088

You must be logged in to reply to this topic.