# JSON SET

## JSON SET

### Set New Json Object Field

<div data-full-width="false"><figure><img src="https://1493671685-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHQWpDyCKZeCL1Ky9OYvt%2Fuploads%2FJbmwL6IUpxrt9q3VMDEv%2FSetNewJsonObjectField.png?alt=media&#x26;token=7f3bdfe9-0794-43e4-8624-3df536ef40ea" alt=""><figcaption></figcaption></figure></div>

{% hint style="info" %}

### Set New Json Object Field

## Overview

Creates a new, empty JSON object and inserts it into the specified field within an existing JSON object. This is typically used as a setup step for nesting further data inside a parent JSON. The newly created object is returned for further use and modification. **not the full original JSON object**.

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

## Inputs

* **JSON Object** – The JSON object to which the new nested object should be added.
* **Field Name** – The name of the field (**as string**) to assign the new empty JSON object to.

## Outputs

* **Success** – Returns true if the empty object was successfully created and inserted. Otherwise false.
* **New Json Object** – The newly created empty object, returned for further editing (**not the full input object**).
  {% endhint %}

***

### Set Json Object Field

<div data-full-width="false"><figure><img src="https://1493671685-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHQWpDyCKZeCL1Ky9OYvt%2Fuploads%2FwHjAerPQSBG7W2va9Rhb%2FSetJSONObjectField.png?alt=media&#x26;token=9b62615b-1ac2-431b-8e66-71981040dbb5" alt=""><figcaption></figcaption></figure></div>

{% hint style="info" %}

### Set Json Object Field

## Overview

Adds or updates a nested JSON object field inside an existing parent JSON object. This node allows you to insert a fully constructed JSON object into another JSON object under a specified field name. If the field already exists, it will be overwritten with the new object.

Unlike [**Set New JSON Object Field**](#set-new-json-object-field), which creates a blank JSON object, this version accepts a fully built JSON object and appends it into a larger JSON.

### Examples

#### Parent Data

**{**\
&#x20; **"PlayerInfo": {**\
&#x20;   **"Name": "ShadowRogue",**\
&#x20;   **"Level": 12,**\
&#x20;   **"Class": "Assassin",**\
&#x20;   **"XP": 3450,**\
&#x20;   **"IsAlive": true**\
&#x20; **}**\
**}**

#### Data To Insert

**{**\
&#x20; **"PlayerStats": {**\
&#x20;   **"Health": 85,**\
&#x20;   **"Mana": 60,**\
&#x20;   **"Stamina": 40,**\
&#x20;   **"Armor": 25,**\
&#x20;   **"CriticalChance": 0.15**\
&#x20; **}**\
**}**

#### Combined Data

**{**\
&#x20; **"PlayerInfo": {**\
&#x20;   **"Name": "ShadowRogue",**\
&#x20;   **"Level": 12,**\
&#x20;   **"Class": "Assassin",**\
&#x20;   **"XP": 3450,**\
&#x20;   **"IsAlive": true**\
&#x20; **},**\
&#x20; **"PlayerStats": {**\
&#x20;   **"Health": 85,**\
&#x20;   **"Mana": 60,**\
&#x20;   **"Stamina": 40,**\
&#x20;   **"Armor": 25,**\
&#x20;   **"CriticalChance": 0.15**\
&#x20; **}**\
**}**

## Inputs

* **JSON Object** – The parent JSON object you want to modify.
* **Object Data** - The desired data to insert into the parent.
* **Field Name** – The name of the field (**as string**) under which the object should be stored.

## Outputs

* **Success** – Returns true if the nested object was successfully inserted. Otherwise false.
* **New Json Object** – The updated full JSON object, including the newly added or modified field.
  {% endhint %}

***

### Insert Json Object

<div data-full-width="false"><figure><img src="https://1493671685-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHQWpDyCKZeCL1Ky9OYvt%2Fuploads%2Fawj12JMhEbW5qwWXjmFA%2FInsertJSONObject.png?alt=media&#x26;token=2f5e9ba2-8496-401d-9544-eeaf68732cfd" alt=""><figcaption></figcaption></figure></div>

{% hint style="info" %}

### Insert Json Object

## Overview

This node merges one JSON object into another by copying all fields from the **Data to Insert** object into the **JSON Object**. If any fields already exist in the target, they will be **overwritten** by values from the incoming object. The result is a single, combined JSON object containing fields from both inputs.

**Note:** This operation does not create a nested structure. All top-level fields from both objects are merged into a flat, unified JSON.

### Examples

#### Parent Data

**{**\
&#x20; **"PlayerInfo": {**\
&#x20;   **"Name": "ShadowRogue",**\
&#x20;   **"Level": 12,**\
&#x20;   **"Class": "Assassin",**\
&#x20;   **"XP": 3450**\
&#x20; **}**\
**}**

#### Data To Insert

**{**\
&#x20; **"PlayerStats": {**\
&#x20;   **"Health": 85,**\
&#x20;   **"Mana": 60,**\
&#x20;   **"Stamina": 40,**\
&#x20;   **"Armor": 25**\
&#x20; **}**\
**}**

#### Combined Data

**{**\
&#x20; **"PlayerInfo": {**\
&#x20;   **"Name": "ShadowRogue",**\
&#x20;   **"Level": 12,**\
&#x20;   **"Class": "Assassin",**\
&#x20;   **"XP": 3450,**\
&#x20;   **"Health": 85,**\
&#x20;   **"Mana": 60,**\
&#x20;   **"Stamina": 40,**\
&#x20;   **"Armor": 25**\
&#x20; **}**\
**}**

## Inputs

* **JSON Object** – The target JSON object that will receive the new fields.
* **Data To Insert** – The second JSON object whose fields will be inserted into the first.

## Outputs

* **Success** – Returns true if the merge was successful. Otherwise false.
* **Combined Json** – The resulting JSON object containing fields from both input objects.
  {% endhint %}

***

### Set Json Bool Field

<div data-full-width="false"><figure><img src="https://1493671685-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHQWpDyCKZeCL1Ky9OYvt%2Fuploads%2FiRzfqngibvuVYgdScFyG%2FSetJSONboolField.png?alt=media&#x26;token=9e91af41-89b4-4dfe-ae47-0517f542d461" alt=""><figcaption></figcaption></figure></div>

{% hint style="info" %}

### Set Json Bool Field

## Overview

Adds or updates a Boolean field in a JSON object. This node sets a key–value pair where the value is a Boolean (**true** or **false**) and outputs a new JSON object containing the updated field.

**Note:** If the specified field already exists, its value will be overwritten. If it does not exist, it will be added.

## Inputs

* **JSON Object** – The input JSON object you want to modify.
* **Field Name** – The name of the field (**as string**) to add or update.
* **Value** - The Boolean value (**true or false**) to assign to the specified field.

## Outputs

* **Success** – Returns true if the field was successfully set in the object. Otherwise false.
* **New Json Object** – The updated JSON object with the Boolean field set.
  {% endhint %}

***

### Set Json Byte Field

<div data-full-width="false"><figure><img src="https://1493671685-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHQWpDyCKZeCL1Ky9OYvt%2Fuploads%2FDEEJaWO93OUO0oKFCGcB%2FSetJSONByteField.png?alt=media&#x26;token=db0d9f26-6764-4074-8f8c-164667f5ee97" alt=""><figcaption></figcaption></figure></div>

{% hint style="info" %}

### Set Json Byte Field

## Overview

Adds or updates a byte value field in a JSON object. This node sets a key–value pair where the value is treated as a byte and outputs a new JSON object containing the updated data.

**Note:** If the specified field already exists, its value will be overwritten. If it does not exist, it will be added.

## Inputs

* **JSON Object** – The input JSON object you want to modify.
* **Field Name** – The name of the field (**as string**) to add or update.
* **Value** - The byte value (**0–255**) to assign to the specified field.

## Outputs

* **Success** – Returns true if the field was successfully set in the object. Otherwise false.
* **New Json Object** – The updated JSON object with the new or modified byte field.
  {% endhint %}

***

### Set Json Number Field

<div data-full-width="false"><figure><img src="https://1493671685-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHQWpDyCKZeCL1Ky9OYvt%2Fuploads%2FA4VJwXCy4jl9hRIdnwYZ%2FSetJSONNumberField.png?alt=media&#x26;token=d7c7b6ee-20eb-4f93-b7c1-a8c00278a0ac" alt=""><figcaption></figcaption></figure></div>

{% hint style="info" %}

### Set Json Number Field

## Overview

Adds or updates a numeric field (**Float**) in a JSON object. This node sets a key–value pair where the value is a number (**float**), and outputs a new JSON object with the updated content.

**Note:** If the specified field already exists, its value will be overwritten. If it does not exist, it will be added.

## Inputs

* **JSON Object** – The input JSON object you want to modify.
* **Field Name** – The name of the field (**as string**) to add or update.
* **Value** - The numeric value (**float**) to assign to the specified field.

## Outputs

* **Success** – Returns true if the field was successfully set in the object. Otherwise false.
* **New Json Object** – The updated JSON object with the number (**float**) field added or changed.
  {% endhint %}

***

### Set Json String Field

<div data-full-width="false"><figure><img src="https://1493671685-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHQWpDyCKZeCL1Ky9OYvt%2Fuploads%2FFUEwaPdhu5pdReOuhP5F%2FSetJSONStringField.png?alt=media&#x26;token=7c5fe56e-a690-4eba-91f5-87fe2d46d836" alt=""><figcaption></figcaption></figure></div>

{% hint style="info" %}

### Set Json String Field

## Overview

Adds or updates a string field in a JSON object. This node sets a key–value pair where the value is a string and outputs a new JSON object containing the updated or newly created field.

**Note:** If the specified field already exists, its value will be overwritten. If it does not exist, it will be added.

## Inputs

* **JSON Object** – The input JSON object you want to modify.
* **Field Name** – The name of the field (**as string**) to add or update.
* **Value** - The string value to assign to the specified field.

## Outputs

* **Success** – Returns true if the field was successfully set in the object. Otherwise false.
* **New Json Object** – The updated JSON object with the string field included.
  {% endhint %}

***

### Set Json Rotator Field

<div data-full-width="false"><figure><img src="https://1493671685-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHQWpDyCKZeCL1Ky9OYvt%2Fuploads%2Fn6stUeprKmBKcChlMNQD%2FSetJSONRotatorField.png?alt=media&#x26;token=d750afdb-dc87-426c-83df-2c1514ed6c38" alt=""><figcaption></figcaption></figure></div>

{% hint style="info" %}

### Set Json Rotator Field

## Overview

JSON functionality used to add or update a **Rotator** field in a JSON object. This node sets a specified field using Unreal Engine **Rotator**, composed of **Roll**, **Pitch**, and **Yaw** values. Ensuring the structure is correctly formatted for JSON serialization.

You must ensure the rotator structure is stored in the expected format. (**As seen in example below**) This node automatically applies the proper formatting, making it the **recommended** way to write rotator data into JSON for compatibility with other JSON utility nodes.

### Example

**{**\
&#x20;  **"PlayerRotation":  {**\
&#x20;     **"Roll": 0,**\
&#x20;     **"Pitch": 0,**\
&#x20;     **"Yaw": -90**\
&#x20;  **}**\
**}**

## Inputs

* **JSON Object –** The JSON object you want to modify.
* **Field Name** – The name of the field (**as string**) to create or update.
* **Rotator Data -** The Unreal Engine **Rotator** value you wish to set.

## Outputs

* **Success** – Returns true if the **rotator** field was successfully added or updated. Otherwise false.
* **New Json Object** - The resulting JSON object with the correctly formatted **rotator** field.
  {% endhint %}

***

### Set Json Vector Field

<div data-full-width="false"><figure><img src="https://1493671685-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHQWpDyCKZeCL1Ky9OYvt%2Fuploads%2FmwjXOgCnfPICPEczfPYH%2FSetJSONVectorField.png?alt=media&#x26;token=138ea4e0-9350-42d5-bb5c-e5db57e04273" alt=""><figcaption></figcaption></figure></div>

{% hint style="info" %}

### Set Json Vector Field

## Overview

JSON functionality used to add or update a **Vector field** in a JSON object. This node takes an Unreal Engine Vector (**composed of X, Y, and Z values**) and assigns it to a specified field within a JSON object using the correct structure.

You must ensure the vector structure is stored in the expected format. (**As seen in example below**) This node automatically applies the proper formatting, making it the **recommended** way to write vector data into JSON for compatibility with other JSON utility nodes.

### Example

**{**\
&#x20;   **"SpawnLocation": {**\
&#x20;   **"X": 120.0,**\
&#x20;   **"Y": 450.0,**\
&#x20;   **"Z": 300.0**\
&#x20; **}**\
**}**

## Inputs

* **JSON Object –** The JSON object you want to modify.
* **Field Name** – The name of the field (**as string**) to create or update.
* **Vector Data -** The Unreal Engine **Vector** value you want to assign, composed of  **X**, **Y**, and **Z**.

## Outputs

* **Success** – Returns true if the **vector** field was successfully written to the JSON object. Otherwise false.
* **New Json Object** - The resulting JSON object with the new or updated **vector** field.
  {% endhint %}

***

### Set Json Vector Field 2D

<div data-full-width="false"><figure><img src="https://1493671685-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHQWpDyCKZeCL1Ky9OYvt%2Fuploads%2FhItMkxI4IqjyxhJTIpY3%2FSetJSONVector2DField.png?alt=media&#x26;token=88e806e1-52d5-45d5-a0d1-f60890f9ba8e" alt=""><figcaption></figcaption></figure></div>

{% hint style="info" %}

### Set Json Vector Field 2D

## Overview

JSON functionality used to safely write a **2D Vector** structure (**Vector2D**) into a JSON object. This node sets the value of a specified field using a **Vector2D**, composed of **X** and **Y** values, and ensures it is formatted correctly for later use.

You must ensure the Vector2D structure is stored in the expected format. (**As seen in example below**) This node automatically applies the proper formatting, making it the **recommended** way to write vector2D data into JSON for compatibility with other JSON utility nodes.

### Example

**{**\
&#x20;   **"PlayerLocation2D": {**\
&#x20;   **"X": 123,**\
&#x20;   **"Y": 321**\
&#x20; **}**\
**}**

## Inputs

* **JSON Object –** The JSON object you want to modify.
* **Field Name** – The name of the field (**as string**) to create or update.
* **Vector Data 2D -** The **Vector2D** value to assign. The **X** and **Y** components will be written into the JSON structure.

## Outputs

* **Success** – Returns true if the field was successfully written into the JSON object. Otherwise, returns false.
* **New Json Object** - The resulting JSON object with the **Vector2D** field added or updated using the correct format.
  {% endhint %}

***

### Set Json Transform Field

<div data-full-width="false"><figure><img src="https://1493671685-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHQWpDyCKZeCL1Ky9OYvt%2Fuploads%2FGgp7TrQ3A95wyZooI7ym%2FSetJSONTransformField.png?alt=media&#x26;token=dd7b2a1c-9c00-4888-83f5-abfdc78c21ed" alt=""><figcaption></figcaption></figure></div>

{% hint style="info" %}

### Set Json Transform Field

## Overview

JSON functionality used to safely write a **Transform** structure into a JSON object. This node sets a specified field using a **Unreal Engine Transform**, composed of a **Location (X, Y, Z)**, **Rotation (Roll, Pitch, Yaw)**, and **Scale** (**Scale X, Scale Y, Scale Z**), all flattened into a single-level JSON format.

You must ensure that the **Transform** structure is stored in the expected format. This node guarantees correct formatting and is the **recommended** way to serialize **Transform** data into JSON.

### Example

**{**\
&#x20;   **"PlayerTransform": {**\
&#x20;   **"X": 123,**\
&#x20;   **"Y": 43,**\
&#x20;   **"Z": 45,**\
&#x20;   **"Roll": 0,**\
&#x20;   **"Pitch": -0,**\
&#x20;   **"Yaw": 90,**\
&#x20;   **"Scale X": 1,**\
&#x20;   **"Scale Y": 1,**\
&#x20;   **"Scale Z": 1**\
&#x20; **}**\
**}**

## Inputs

* **JSON Object –** The JSON object you want to modify.
* **Field Name** – The name of the field (**as string**) to create or update.
* **Transform Data -** The Unreal Engine **Transform** value, including **Location**, **Rotation**, and **Scale** components.

## Outputs

* **Success** – Returns true if the Transform field was successfully written into the JSON object. Otherwise false.
* **New Json Object** - The resulting JSON object with the flattened **Transform** structure added or updated.
  {% endhint %}

***

### Set Json Color Field

<div data-full-width="false"><figure><img src="https://1493671685-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHQWpDyCKZeCL1Ky9OYvt%2Fuploads%2FORudWJAQLEXpDNYrq1O8%2FSetJSONColorField.png?alt=media&#x26;token=ecbe07c7-199a-489e-a74a-39c13fd45634" alt=""><figcaption></figcaption></figure></div>

{% hint style="info" %}

### Set Json Color Field

## Overview

JSON functionality used to add or update a color structure in a JSON object. This node takes an Unreal Engine **Linear Color** (**composed of R, G, B, and A values**) and sets it as the value of a specified object field in the JSON object.

You must ensure the **Linear Color** structure is stored in the expected format. (**As seen in example below**) This node automatically applies the proper formatting, making it the **recommended** way to write **Linear Color** data into JSON for compatibility with other JSON utility nodes.

### Example

**{**\
&#x20;   **"Torch Color": {**\
&#x20;   **"R": 255,**\
&#x20;   **"G": 0,**\
&#x20;   **"B": 50,**\
&#x20;   **"A": 255**\
&#x20; **}**\
**}**

## Inputs

* **JSON Object –** The input JSON object you want to modify.
* **Field Name** – The name of the field (**as string**) to add or update.
* **New Color -** The Unreal Engine **Linear Color** you want to assign to the specified field.

## Outputs

* **Success** – Returns true if the field was successfully written to the object. Otherwise, returns false.
* **New Json Object** - The resulting JSON object with the properly formatted color structure added or updated.
  {% endhint %}

***

### Set Json Array Field

<div data-full-width="false"><figure><img src="https://1493671685-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHQWpDyCKZeCL1Ky9OYvt%2Fuploads%2FcngEaAYIkavlkonEFY7a%2FSetJSONArray.png?alt=media&#x26;token=c6dd0896-1b81-420d-8a04-c14aa434cfd7" alt=""><figcaption></figcaption></figure></div>

{% hint style="info" %}

### Set Json Array Field

## Overview

JSON functionality used to add or update an array field in a JSON object. This node sets a field to hold a JSON array, which can contain values of any type (**Numbers, strings, objects, or nested arrays**), and ensures it is properly formatted for serialization.

## Inputs

* **JSON Object** – The JSON object you want to modify.
* **Field Name** – The name of the field (**as string**) to assign the array to.
* **Root Level JSON** – If **true**, all array entries are placed together into a single object where each entry shares the **same structure** (i.e. same fields, with different values). If **false**, each array entry is placed into its **own individual JSON object**, typically with only one field per object.
* **Array Data** – The array of values to insert into the JSON object.

### Examples

**Root Level JSON = false**

**{**\
&#x20;    **"Inventory": \[**\
&#x20;   **{**\
&#x20;     **"Name": "Health Potion"**\
&#x20;   **},**\
&#x20;   **{**\
&#x20;    **"Type": "Weapon"**\
&#x20;   **},**\
&#x20;   **{**\
&#x20;    **"Effect": "Fireball"**\
&#x20;   **}**\
&#x20;  **]**\
**}**

**Root Level JSON = true**

**\[**\
&#x20;  **{**\
&#x20;   **"Name": "Health Potion",**\
&#x20;   **"Type": "Consumable",**\
&#x20;   **"Effect": "Restore 50 HP"**\
&#x20;  **},**\
&#x20;  **{**\
&#x20;   **"Name": "Iron Sword",**\
&#x20;   **"Type": "Weapon",**\
&#x20;   **"Effect": "Ice walking"**\
&#x20;  **},**\
&#x20;  **{**\
&#x20;   **"Name": "Magic Scroll",**\
&#x20;   **"Type": "Spell",**\
&#x20;   **"Effect": "Fireball"**\
&#x20;  **}**\
**]**

## Outputs

* **Success** – Returns true if the array was successfully added or updated in the JSON object. Otherwise, returns false.
* **Out Array Data** – The JSON array that was written to the specified field or to the root, depending on the configuration.
  {% endhint %}
