Skip to content

Function for recursively exploring Dictionaries and Collections in Parsed JSON? #302

@xeijin

Description

@xeijin

@timhall (or indeed anyone else)

I have some fairly complex JSON (can't post from work unfortunately due to restrictions) which ends-up being parsed like so by VBA-JSON:

Dict > Coll > Dict > String

Unfortunately I have about 273 items like this in my JSON, at varying depths (some deeper than the above) and of course a mix of Collections and Dictionaries.

Could someone point me in the right direction with regards to how best to write a function to access the information I need in a pragmatic or exploratory way? I was thinking along the lines of a recursive For Loop that checks the type of key (Dictionary, Collection or Other) continuing to delve deeper as-necessary. Unfortunately my experiments don't seem to have worked out (specifically: https://codereview.stackexchange.com/questions/63353/traversing-and-printing-complex-dictionary-types-scripting-dictionary-dictio I am unfortunately getting Type mismatch errors when I eventually get to the combination of key that is a dictionary, but sits within a collection (e.g. c(key)).

Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions