Flatten Json Dictionary and Select Value By Path

Just curious if anyone has a script to flatten a Json Dictionary and then similarly I would like to select through a Json Dictionary from the path (example: “$.info.type[0].property” as variant)

Ideally for flattening I would like to see it return a dictionary with the the keys being the property paths minus the standardized “$.” part.

And ideally for path selection wouldn’t require the flattening to occur, and just be a method call.

I don’t think either would be particularly hard to write. I just wasn’t sure if this was done already or if it would be worth a feature request as I believe the path selection is a pretty common scenario for accessing properties of a Json document.

I’ve attempted/done a few implementations, based on Einhugur’s JSON plugin. I would recommend looking into the specs for JSONPointer and JSONPath for some inspiration.

If you are interested I could dig up some code. A code sharing project has been on my to-do list for a while… :slight_smile: