How can I plot a nested property?

A user asked recently, over email:

Question: My agent has a dictionary property with several keys that I want to plot.

{
  “Foo”: {“bar”: 1, “baz”: 2}
}

However, the nested values don’t appear in the analysis wizard. How can I plot the value of bar?

Answer: Nested field values won’t show up in the analysis wizard, but you can still grab them by editing the JSON of the analysis file. Click inside the analysis folder and open analysis.json. You can set your metric to first get the top level property, and then get the second property, like so:

 "outputs": {"MyMetric": [{"op": "get", "field": "foo"}, 
{"op": "get", "field": "bar"}, {"op": "sum"}]},