# JSON SET

## JSON SET

### Set New Json Object Field

<div data-full-width="false"><figure><img src="https://2786877351-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRGKyfCW2RkMZ0cdEFCcN%2Fuploads%2FEiqQEB7TKRyGmlyDbCAb%2FSetNewJsonObjectField.png?alt=media&#x26;token=833029b5-f4ea-48d3-bd1e-7b87e91fb96e" 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://2786877351-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRGKyfCW2RkMZ0cdEFCcN%2Fuploads%2FscZHS0xYNxXKkdFo9NwZ%2FSetJSONObjectField.png?alt=media&#x26;token=6fb034bd-e523-417f-8106-78de167b717f" 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://2786877351-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRGKyfCW2RkMZ0cdEFCcN%2Fuploads%2FSl2WgjjzjnAUCNIDOsOY%2FInsertJSONObject.png?alt=media&#x26;token=33cc67a1-bc51-45e9-a64b-7e319ee11407" 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://2786877351-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRGKyfCW2RkMZ0cdEFCcN%2Fuploads%2FNw9DLmqglkWXu5LafRXw%2FSetJSONboolField.png?alt=media&#x26;token=bcd979ad-fa76-4d4a-90ca-d41426f64f0b" 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://2786877351-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRGKyfCW2RkMZ0cdEFCcN%2Fuploads%2FviEkzvAs1p0I4zV5XL1p%2FSetJSONByteField.png?alt=media&#x26;token=f8c1a604-70f4-4284-84b4-b918e2fa1e1f" 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://2786877351-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRGKyfCW2RkMZ0cdEFCcN%2Fuploads%2FdDEfGrQ937tpFHhdqSiZ%2FSetJSONNumberField.png?alt=media&#x26;token=3b06eaeb-a4ef-431d-a1d7-7f3316bcfb78" 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://2786877351-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRGKyfCW2RkMZ0cdEFCcN%2Fuploads%2FQ5siSnZJAUw6T2yFmYTg%2FSetJSONStringField.png?alt=media&#x26;token=a92e5785-e393-41df-a6ad-cec14c9dcb03" 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://2786877351-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRGKyfCW2RkMZ0cdEFCcN%2Fuploads%2F83Re8q9OShNWtYheNIWc%2FSetJSONRotatorField.png?alt=media&#x26;token=2e7a0bf5-260c-455b-ad34-be003ff45245" 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://2786877351-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRGKyfCW2RkMZ0cdEFCcN%2Fuploads%2F23iEjM0ZDIa6ODZoZK35%2FSetJSONVectorField.png?alt=media&#x26;token=8bcba428-c164-4d38-960d-292b23f93943" 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://2786877351-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRGKyfCW2RkMZ0cdEFCcN%2Fuploads%2FeISxWbuaAPUqY4LmGMFp%2FSetJSONVector2DField.png?alt=media&#x26;token=1462f0bc-0428-4a26-9c44-840947bfbfd2" 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://2786877351-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRGKyfCW2RkMZ0cdEFCcN%2Fuploads%2FInQtMxLjkaXxgULtjgcY%2FSetJSONTransformField.png?alt=media&#x26;token=97e06250-0247-4f15-8cc8-e5b2f05c1e99" 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://2786877351-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRGKyfCW2RkMZ0cdEFCcN%2Fuploads%2FfreKZyNWsT7eEX1skg3P%2FSetJSONColorField.png?alt=media&#x26;token=c558a548-0306-4eb0-8d35-8dad3b09a3f3" 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://2786877351-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRGKyfCW2RkMZ0cdEFCcN%2Fuploads%2FpUTqzmztTmFQ9ann4GNs%2FSetJSONArray.png?alt=media&#x26;token=4a7674ee-43c4-46ed-bdda-799ee56ec4cc" 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 %}
