# JSON file returns empty values in packaged build

**URL:** <https://forums.unrealengine.com/t/json-file-returns-empty-values-in-packaged-build/2382065>\
**Category:** Blueprint\
**Tags:** unreal-engine, plugin, UE5, issue, json, Plugins, question, Blueprint\
**Created:** [March 9, 2025, 3:41pm UTC](https://forums.unrealengine.com/t/json-file-returns-empty-values-in-packaged-build/2382065 "2025-03-09T15:41:10Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![PixelIndieDev](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/pixelindiedev/32/1035020_2.png) [@PixelIndieDev](https://forums.unrealengine.com/u/PixelIndieDev)\
**Post date:** [March 9, 2025, 3:41pm UTC](https://forums.unrealengine.com/t/json-file-returns-empty-values-in-packaged-build/2382065/1 "2025-03-09T15:41:10Z")

</div>

Hi,  
I’m using Unreal Engine 5.5’s built-in JSON plugin to read a local JSON file. The JSON file contains a structure.  
Everything works fine in-editor. The file is read correctly, and the values are displayed on screen. However, after packaging my project, the JSON file always returns the default/empty values of my structure instead of the actual contents.

Has anyone encountered this issue before?

---

<div class="post-metadata">

**Author:** ![3dRaven](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/3draven/32/906552_2.png) [@3dRaven](https://forums.unrealengine.com/u/3dRaven)\
**Post date:** [March 9, 2025, 3:49pm UTC](https://forums.unrealengine.com/t/json-file-returns-empty-values-in-packaged-build/2382065/2 "2025-03-09T15:49:35Z")

</div>

> [@PixelIndieDev](#):
>
> N file contains a structure.  
> Everything works fine in-editor. The file is read correctly, and the values are displayed on screen. However, after packaging my project, the JSON file always returns the default/empty values of my structure ins

Is the json file present physically in the packed build? It might not be packed by default.

---

<div class="post-metadata">

**Author:** ![PixelIndieDev](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/pixelindiedev/32/1035020_2.png) [@PixelIndieDev](https://forums.unrealengine.com/u/PixelIndieDev)\
**Post date:** [March 9, 2025, 3:55pm UTC](https://forums.unrealengine.com/t/json-file-returns-empty-values-in-packaged-build/2382065/3 "2025-03-09T15:55:06Z")

</div>

I’m reading from a file. It’s a file located in the user directory.

With my project, the json file is not included in the packaged build. It’s a seperate file from the project.

In-editor and in the packaged build, the file in question is the exact same file located in the user directory. Only for some reason in the packaged build, it returns default values even tho the success bool says success and even tho the in-editor version reads the local file with no problems.

---

<div class="post-metadata">

**Author:** ![3dRaven](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/3draven/32/906552_2.png) [@3dRaven](https://forums.unrealengine.com/u/3dRaven)\
**Post date:** [March 9, 2025, 3:58pm UTC](https://forums.unrealengine.com/t/json-file-returns-empty-values-in-packaged-build/2382065/4 "2025-03-09T15:58:12Z")

</div>

It could be a matter of file permissions. The editor has elevated status in regards to file access compared to the packaged game.

For a test try moving the file to a non protected folder and see if it works.

---

<div class="post-metadata">

**Author:** ![PixelIndieDev](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/pixelindiedev/32/1035020_2.png) [@PixelIndieDev](https://forums.unrealengine.com/u/PixelIndieDev)\
**Post date:** [March 9, 2025, 4:14pm UTC](https://forums.unrealengine.com/t/json-file-returns-empty-values-in-packaged-build/2382065/5 "2025-03-09T16:14:17Z")

</div>

Even in a non-protected folder it doesn’t read the file correct.  
Saving does work correctly, even if the json file is in a protected folder.

---

<div class="post-metadata">

**Author:** ![3dRaven](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/3draven/32/906552_2.png) [@3dRaven](https://forums.unrealengine.com/u/3dRaven)\
**Post date:** [March 9, 2025, 4:31pm UTC](https://forums.unrealengine.com/t/json-file-returns-empty-values-in-packaged-build/2382065/6 "2025-03-09T16:31:27Z")

</div>

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/3/6/7369529254e76a9a139a48b0f2a4d03b2a9528f1.png)

Blueprint function library to get user path

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/8/a/a8a455e1a045fc6c3767aed652c2f3e9d28b40fc.png)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/6/9/b6950715c2b3770db8d05aca41d242b607223d81.png)

File in: C:\Users\YourName\AppData

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/4/0/74040578204e3fa0a1909707429c675629ad5cde.png)

File internals

 ![file](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/9/b/99bad3b9aa9e0be9ca3cfcbf8d727ecfacc9a288.png)

In packed project

![doe](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/f/5/4f59d5b7d685d339a36c15323c67c86d823aba99.png)

Works in packed version no problem.

And in shipping added a quick widget for tests as print string is stripped.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/d/1/5d1f05f6edbbc2e594955af1fea322546a375f5e.png)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/5/8/e580570c03c166a68a53c299a308f49323f679f6.png)

Shows up no problems

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/a/2/4a2371c961628742eaadf95b0e29d9e2f8d2f4f9.jpeg)

Double check your filename. Maybe you have an extra space at the end or something that is throwing off the engine. Check if the json is also valid via json lint.

---

<div class="post-metadata">

**Author:** ![PixelIndieDev](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/pixelindiedev/32/1035020_2.png) [@PixelIndieDev](https://forums.unrealengine.com/u/PixelIndieDev)\
**Post date:** [March 9, 2025, 5:42pm UTC](https://forums.unrealengine.com/t/json-file-returns-empty-values-in-packaged-build/2382065/7 "2025-03-09T17:42:12Z")

</div>

I found out that he reads everything in the json file correctly, except for arrays.  
For some reason arrays will always have their default value parsed thru in the packaged build.

Do arrays have this issue with you too?

I checked if my json is valid, and it’s valid.

---

<div class="post-metadata">

**Author:** ![3dRaven](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/3draven/32/906552_2.png) [@3dRaven](https://forums.unrealengine.com/u/3dRaven)\
**Post date:** [March 9, 2025, 8:08pm UTC](https://forums.unrealengine.com/t/json-file-returns-empty-values-in-packaged-build/2382065/8 "2025-03-09T20:08:09Z")

</div>

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/7/1/771839d7fcb5f4032fdf441a94f6335f1fd18869.png)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/c/9/ec9e007164c2c19cb225d5fc61c46a7e07712a98.png)

 ![json](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/9/a/09a92c60e5bd7d7c92eae49c744b3623e1648c45.png)

code to de-serialize json with arrays (where UPathLibrary is the library, replace with own class name)

```auto

TMap<FString, FString> UPathLibrary::DeSerializeJsonContent(const FString& JsonContent)
{
	TMap<FString, FString> ReturnMap;

	TSharedPtr<FJsonObject> JsonObject;
	TSharedRef<TJsonReader<>> Reader = TJsonReaderFactory<>::Create(JsonContent);

	if (FJsonSerializer::Deserialize(Reader, JsonObject) && JsonObject.IsValid())
	{
		for (const TPair<FString, TSharedPtr<FJsonValue>>& Pair : JsonObject->Values)
		{
			CheckJsonType(Pair, &ReturnMap);
		}
	}
	return ReturnMap;
}

void UPathLibrary::CheckJsonType(TPair<FString, TSharedPtr<FJsonValue>> Json, TMap<FString, FString>* Map)
{
	if (Json.Value->Type == EJson::Object || Json.Value->Type == EJson::Array)
	{
		if (Json.Value->Type == EJson::Object)
		{
			for (const TPair<FString, TSharedPtr<FJsonValue>>& Pair : Json.Value->AsObject()->Values)
			{
				CheckJsonType(Pair, Map);
			}
		}
		else if (Json.Value->Type == EJson::Array)
		{
			int32 Index = 1;
			for (const auto& ArrayValue : Json.Value->AsArray())
			{
				Map->Add(Json.Key + "_" + FString::FromInt(Index), ArrayValue->AsString());
				Index++;
			}
		}
	}
	else
	{
		Map->Add(Json.Key, Json.Value->AsString());
	}
}

```

You need to add module “Json” to the build file

based on post

> [@Parse nested json to TMap in Unreal Engine 4](https://forums.unrealengine.com/t/parse-nested-json-to-tmap-in-unreal-engine-4/157998/5):
>
> TMap\<FString, FString\> URequestManagerBase::DeSerializeJsonContent(const FString& JsonContent) { TMap\<FString, FString\> ReturnMap; TSharedPtr\<FJsonObject\> JsonObject; TSharedRef\<TJsonReader\<\>\> Reader = TJsonReaderFactory\<\>::Create(JsonContent); if (FJsonSerializer::Deserialize(Reader, JsonObject) && JsonObject.IsValid()) { for (const TPair\<FString, TSharedPtr\<FJsonValue\>\>& Pair : JsonObject-\>Values) { CheckJsonType(Pair, &ReturnMap); } } return ReturnMap; } void URequestManager…

You could also go the route of using `FJsonObjectConverter::JsonObjectStringToUStruct`

> **[FJsonObjectConverter::JsonObjectStringToUStruct | Unreal Engine 5.5...](https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/JsonUtilities/FJsonObjectConverter/JsonObjectStringToUStruct)**
>
> Converts from a json string containing an object to a \[UStruct\](API\\Runtime\\CoreUObject\\UObject\\UStruct)

---

<div class="post-metadata">

**Author:** ![PixelIndieDev](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/pixelindiedev/32/1035020_2.png) [@PixelIndieDev](https://forums.unrealengine.com/u/PixelIndieDev)\
**Post date:** [March 11, 2025, 12:59pm UTC](https://forums.unrealengine.com/t/json-file-returns-empty-values-in-packaged-build/2382065/9 "2025-03-11T12:59:48Z")

</div>

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/2/7/a276f5d6ff2c2509d467b53028ebc722c864e8ad.png)  
Our arrays look different from each other. My array looks more in the lines of the image attached.

---

<div class="post-metadata">

**Author:** ![3dRaven](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/3draven/32/906552_2.png) [@3dRaven](https://forums.unrealengine.com/u/3dRaven)\
**Post date:** [March 11, 2025, 1:00pm UTC](https://forums.unrealengine.com/t/json-file-returns-empty-values-in-packaged-build/2382065/10 "2025-03-11T13:00:58Z")

</div>

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/e/a/3ea7fb9f167052c92f0b2083e86f4cc42c94a732.png)

Result with the following json

simplified

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/e/e/7ee998f16597d39bd8b98df0c8cd82260baa04ad.png)

The mapping function would just need to be rebuilt to support arrays as values so that it doesn’t create an incremented key.

But nonetheless it does register the array as a value and display it.

Though if you know the targeted outcome structure, I would strongly suggest using the inbuilt engine function to convert it to a targeted ustruct.

---

<div class="post-metadata">

**Author:** ![PixelIndieDev](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/pixelindiedev/32/1035020_2.png) [@PixelIndieDev](https://forums.unrealengine.com/u/PixelIndieDev)\
**Post date:** [March 17, 2025, 7:18pm UTC](https://forums.unrealengine.com/t/json-file-returns-empty-values-in-packaged-build/2382065/11 "2025-03-17T19:18:31Z")

</div>

I fixed my issue.  
My issue was caused by the use of capital letters and/or spaces in my variable names. That caused the ‘get field’ node to stop functioning in the packaged build.

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [April 16, 2025, 7:19pm UTC](https://forums.unrealengine.com/t/json-file-returns-empty-values-in-packaged-build/2382065/12 "2025-04-16T19:19:11Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
