From Derivative
Jump to navigation Jump to search


The JSON DAT converts and filters JSON text using JSONPath syntax and outputs the filtered results. It eliminates having to code scripts to parse and manipulate JSON, and keeps the data flow procedural.

It expects JSON text as input and converts the input to a Python object in the DAT.source member.

It then filters the JSON down using the JSONPath Filter parameter, and it outputs the resulting data from the DAT as JSON text.

It also puts the filtered results as DAT.results (a Python list of results) and DAT.result (the first result).

You can test expressions on DAT.source, DAT.result and DAT.results by setting the Output menu to Expression and using expressions like me.result['city'], which outputs the evaluated expression from the DAT. You can then use that expression as op('json1').result['city'] in an expression elsewhere. DAT.expr is also a member of the JSON DAT, for example, op('json1').expr returns the evaluated expression parameter.

See also: JSONPath, OP Snippets, and the TDJSON functions for converting and manipulating JSON data.


Parameters - JSON Page

Filter filter - A filter string following JSONPath syntax that will be used to filter the input JSON.

Output output - - Select the output of the JSON DAT.

  • Filter Result filterresult - Outputs list returned from applying the filter to the JSON text input.
  • Expression expression - Output a custom expression.

Expression expression - The custom expression to output

Format Output formatoutput - When enabled, the output of the DAT will formatted with indents and newlines.

Hold Last Non-Empty Results holdlast - When enabled, the most recent result will be held if the results become empty, in effect only new non-empty results will update the output.

Parameters - Common Page

Language language - - Select how the DAT decides which script language to operate on.

  • Input input - The DAT uses the inputs script language.
  • Node node - The DAT uses it's own script language.

Edit/View Extension extension - - Select the file extension this DAT should expose to external editors.

  • dat dat - various common file extensions.
  • frag frag -
  • glsl glsl -
  • html html -
  • md md -
  • py py -
  • rtf rtf -
  • tsv tsv -
  • txt txt -
  • vert vert -
  • xml xml -
  • From Language languageext - pick extension from DATs script language.
  • Custom Extension customext - Specify a custom extension.

Custom Extension customext - Specifiy the custom extension.

Word Wrap wordwrap - - Enable Word Wrap for Node Display.

  • Input input - The DAT uses the inputs setting.
  • On on - Turn on Word Wrap.
  • Off off - Turn off Word Wrap.

Operator Inputs

  • Input 0 - A JSON text input.

TouchDesigner Build:

Art-Net • CHOP Execute • CHOP to • Clip • Convert • CPlusPlus • DAT •  Execute • DAT Export • Error • EtherDream • Evaluate • Examine • Execute • FIFO • File In • File Out • Folder • In • Indices • Info • Insert • JSON • Keyboard In • Lookup • Merge • MIDI Event • MIDI In • Monitors • MQTT Client • Multi Touch In • NDI • Null • OP Execute • OP Find • OSC In • OSC Out • Out • Panel Execute • Parameter • Parameter Execute • Perform • Render Pick • Reorder • Script • Select • Serial • SocketIO • SOP to • Sort • Substitute • Switch • Table • TCP/IP • Text • Touch In • Touch Out • Transpose • TUIO In • UDP In • UDP Out • UDT In • UDT Out • Web Client • Web • Web Server • WebSocket • XML