Fetch JSON Tree (vuo.tree.fetch.json)

Loads or downloads a file containing JSON-formatted text, and turns the text into a tree.

See vuo.url for info on how Vuo handles URLs.

If there’s an error in the JSON, this node outputs an empty tree. Check Console.app for details about the error.

Name-value pairs in JSON objects roughly correspond to trees.

A name-value pair whose value is a string, number, boolean, or null is turned into a tree whose name is the name from the pair and whose content is the value, like this:

{ "title" : "China Mountain Zhang" }

A name-value pair whose value is an object is turned into a tree with children, like this:

{ "book" :
   { "title" : "China Mountain Zhang",
     "author" : "Maureen F. McHugh"

A name-value pair whose value is an array is turned into a tree with children whose names are the name from the pair, like this:

{ "book" :
   { "award" :
      [ "James Tiptree, Jr. Memorial Award",
        "Lambda Literary Award",
        "Locus Award for Best First Novel"

If the outermost JSON is something other than an object containing a single name-value pair, a parent tree is added when transforming the JSON to a tree, like this:

[ 1992, 1994, 1998, 2001 ]

This node is a shortcut for Fetch Data -> Convert Data to Text -> Make Tree from JSON.

Keywords: convert, descendant, dom, download, element, file, get, hierarchical, hierarchy, html, http, import, json, leaf, load, make, object, open, parent, parse, read, structure, tag, url, xml

Example compositions:

Back to vuo.tree node set documentation.