More Detailed Examples in Docs

It would be great to have more detailed examples in the docs regarding retrieving values from datasets/dictionaries, in scripts.

For example, if a query returns this into a variable, using scripting on an event action:

{"columns":[{"name":"","type":"java.lang.Integer"},{"name":"","type":"java.lang.Integer"}],"rows":[[103864,4031]]}

What is the return string format/language?
How would someone get either of the two integer values?
We could use a PyDataset, or JSON, or some function such as getValueAt()

The examples in the docs are very simple and don't really cover this topic well. I use databases a lot and can return what I need with SQL, but attempting to sort through a dataset with Python or JSON is a steep hill to climb.

Having said that, shout out to all the people on the forums that have taught me along the way.

So, just a thought to add to the docs...
Mike

There isn't really a particular name for this format. This looks like one possible "flattening" of a dataset into native Python objects. Native Python lists and dictionaries also map well to JSON, so you can kind of squint and call this format JSON-like.

There's not a ton to "explain", here, though. You access members like you access members of any other Python dict or list. It's all still Python.

So what you're saying is: Take the Inductive Training Classes! :rofl:

Not really, it's more a Python class. IA scripting classes might go into it, but any basic Python class will get you there too

3 Likes