JSON PURE

JSON PURE

Try Get Json Length

Try Get Json Length

Overview

Attempts to determine the number of key-value pairs inside a given JSON object. This is a pure function that inspects the structure and returns how many fields are present at the top level of the object. Commonly used when iterating through dynamic or unknown JSON data lengths and a length is required.

Note: This node does not copy the entire structure forward. It only returns the newly created nested object so you can build into it directly.

Inputs

  • JSON Object – The JSON object whose length (number of fields) you want to retrieve.

Outputs

  • Length – An integer representing the number of fields (keys) in the provided JSON object.


Try Get Json Value

Set Json Object Field

Overview

This node is a universal “Try Get” function that combines the functionality of all individual JSON “Try Get” nodes into one pure function. It dynamically determines the type of value to retrieve based on the variable type connected to the Out Data output pin. This allows developers to fetch Booleans, strings, numbers, objects and more using one flexible node.

Note: The wildcard pin must be set before execution. The node will search for the field based on the data type connected to Out Data.

Inputs

  • JSON Object – The JSON object to search within.

  • Field Name - The name of the field (as a string) to retrieve.

Outputs

  • Out Data (Wildcard) – The resulting value found from the JSON object.


Try Get First Json Field Value

Try Get First Json Field Value

Overview

This node retrieves the value of the first field found in a JSON object. The type of the value to be retrieved is determined by the variable connected to the Out Data pin (Wildcard). This is useful when you want to inspect or access the first entry of a JSON structure.

Inputs

  • JSON Object – The JSON object from which the first value will be retrieved.

Outputs

  • Out Data – The value of the first found field.


New Json Object From String

New Json Object From String

Overview

This node creates a local JSON object from a string without needing a execution pin. It is a pure function and is often used when working with inline JSON or when importing data from a string format. The provided string must be valid JSON syntax.

Note: If you want to quickly debug JSON data or dynamically parse a string into a JSON object, this is a useful node. However, since it is a pure function, the resulting data exists only for the current frame. Be sure to store or process the output immediately, as the data will be lost on the next engine frame.

Inputs

  • In Json String – A text string containing valid JSON data to be parsed.

Outputs

  • Out Value – A JSON object generated from the input string. If the string is invalid, the object may be empty.


New Pure Json Object

New Pure Json Object

Overview

Creates a new, empty JSON object using a pure function. Since this node does not trigger the execution flow, it is ideal for temporary JSON creation in pure logic chains such as function graphs or value assignments.

Note: Because it is a pure function, the generated JSON object exists only during the current frame. Be sure to immediately cache or assign the output, or the data will be lost.

Outputs

  • JSON Object – A new, empty JSON object that can be modified or passed into other JSON-related nodes.

Make Named Object Json Data

Make Named Object Json Data

Overview

This pure function accepts two arrays as input. The first is an array of strings, where each string represents a key that will be used to construct a JSON object. The second is a wildcard array that provides the values to be assigned to each of these keys.

It is important to note that the number of keys must match the number of values exactly. You cannot provide more keys than values or more values than keys. This mismatch is not supported and will result in an error.

An example of the output generated by this function can be found below.

Example

Parent Data

{ "Username": "UForge", "Password": "UForge123", "Address": "UForge road", "Class": "Mage" }

Inputs

  • Field Names Array – An array of string values that represent the keys for the resulting JSON object.

  • In Array – A wildcard array input. This node accepts any data type supported by Unreal Engine. It loops over each value and assigns it to the corresponding key from the Field Names Array, building valid key-value pairs.

Outputs

  • Out Data – JSON object that holds the new constructed JSON data.


Set JSON Field

Set JSON Field

Overview

A pure node that allows you to set data into your desired JSON object. The input supports any data type recognized by Unreal Engine, as it uses a wildcard input. This node essentially functions as a universal "Set Node," combining the behaviour of all individual set nodes into one.

Inputs

  • JSON Object – The JSON object where you want to set a new JSON value.

  • Field Name – The name of the field you are creating.

  • In Data (Wildcard) – The data you want to set. This is a wildcard input pin, so it supports any valid data type recognized by Unreal Engine.

Outputs

  • Out Data – The new JSON object that contains the newly created JSON field.


Value Only JSON Array

Value Only JSON Array

Overview

A pure JSON node that allows you to create a JSON array containing only values, with no keys assigned to individual elements. The output structure looks like this: {"words": ["AB", "BC", "CD", "DE", "EF"]}. To use this node, simply provide a field name and an array containing your data.

Inputs

  • Field Name – The name of the JSON array you wish to create.

  • In Array (Wildcard) – A wildcard input pin that accepts any data type supported by Unreal Engine. This is the array of data you want to include in the value-only JSON array.

Outputs

  • Out Data – The new JSON object that contains the value-only JSON array.

Last updated

Was this helpful?