Table Of Contents

Unflatten from JSON (G Dataflow)

Last Modified: January 9, 2017

Converts a UTF-8 JavaScript Object Notation (JSON) string to another data type.

connector_pane_image
datatype_icon

enable LabVIEW extensions

A Boolean that determines whether LabVIEW JSON extensions support NaN and Inf values of floating-point numbers. Not all JSON parsers support these extensions.

True Enable LabVIEW JSON extension support of NaN and Inf values of floating-point numbers.
False Disable LabVIEW JSON extension support of NaN and Inf values of floating-point numbers.

Default: True

datatype_icon

path

A specific item in the JSON string. Use path if your JSON string contains multiple items and you would like to extract a specific item from it. path uses an array of strings to identify the item, where each element in the array references either the name of a cluster element or an integer index of an array. If you specify an item using path, you must wire a data type to type and defaults that corresponds to the data type of the specified item.

datatype_icon

JSON string

The flattened UTF-8 string that you want to unflatten.

datatype_icon

type and defaults

The data type and default values to which you want to unflatten the JSON string. This input accepts Booleans, integers, floating-point numbers, strings, and arrays or clusters of these types. Cluster elements may be labeled or unlabeled, but not a combination of both. If elements in a cluster are labeled, then each name must be unique to that cluster. If elements in your JSON string are labeled, the elements wired to type and defaults must have an identical label. For example, if you have JSON string {"firstelement":"a","secondelement":"b"}, you must wire a cluster containing a string labeled firstelement and a string labeled secondelement. Additionally, if you specify the path to a particular item in your JSON string, the data type wired to type and defaults must match the data type of the item pointed to by path.

datatype_icon

error in

Error conditions that occur before this node runs. The node responds to this input according to standard error behavior.

Default: No error

datatype_icon

default null elements?

A Boolean that determines how LabVIEW processes null values in JSON string.

True LabVIEW uses default values from the input cluster for null values in JSON string.
False LabVIEW returns an error for null values.

Default: False

datatype_icon

strict validation?

A Boolean that determines whether LabVIEW returns an error when JSON string contains items not defined in type and defaults.

True LabVIEW returns an error when JSON string contains items not defined in type and defaults.
False The JSON object may contain items not defined in type and defaults.

Default: False

datatype_icon

value

Unflattened data of the same data type and structure as type and defaults.

datatype_icon

error out

Error information. The node produces this output according to standard error behavior.

Converting Data Types not Supported by Type and Defaults

If JSON string represents a data type that type/defaults does not accept, such as an array of arrays or an array of mixed types, you cannot use a single Unflatten From JSON function to convert the entire JSON string. However, you can use path to identify and extract items in the JSON string.

Where This Node Can Run:

Desktop OS: Windows

FPGA: Not supported


Recently Viewed Topics