JSON builder

Creates an array or a dictionary, and serializes it to JSON.


Inputs

  • mode

    • Sets the mode in which a JSON is built. This can be: Array or Dictionary.
  • keys

    • The list of string values that defines the dictionary keys when mode is set to Dictionary.
  • values

    • The list of varying values to be built into a JSON string. This can be a list of any data type (number, string, or vector).

Outputs

  • JSON

    • The array, or dictionary, as a JSON string.

Note(s)

  • When the mode input is set to Dictionary the input lists of keys and values must be of equal length.

  • Typically this node is used to build a JSON string to provide a list of parameters and values to a graph asset node.

    • If you are building a parameter set for a graph asset, parameter names (a string list) need to be provided as keys, and values for those parameters need to be provided as values within a dictionary format.

    • As parameters can be of many different data types, a combine data node is often used to supply the input for the values input.

  • Other names for this node include: JSONBuilder and JSON string.

Example(s)