# Struct to JSON

**URL:** <https://forums.unrealengine.com/t/struct-to-json/1679567>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine, json, question, Blueprint\
**Created:** [February 10, 2024, 7:04pm UTC](https://forums.unrealengine.com/t/struct-to-json/1679567 "2024-02-10T19:04:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Herlehos](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/herlehos/32/899268_2.png) [@Herlehos](https://forums.unrealengine.com/u/Herlehos)\
**Post date:** [February 10, 2024, 7:04pm UTC](https://forums.unrealengine.com/t/struct-to-json/1679567/1 "2024-02-10T19:04:22Z")

</div>

Hi there!

I have created a little dialogue tool for a RPG project inside a Editor Utility Widget, so my designers can create content directly inside Unreal with a cool interface (better than in Google Sheets 😛 ).

I store all dialogues information inside a struct, and I read that you can convert a struct to a json file, then convert this json file into a data table.

I don’t understand how to do it in blueprint.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/7/f/47f2890bb69f159e2fb80a4c548df4caf10d2b8c.png)

I have tried this, but the “Convert struct to json string” always returns “false”.

Am I even doing things right? x)

* * *

In short: I have a struct, I want to convert it into a file (JSON / CSV / other).

Then, I want to import this file in UE to update a data table, like I would do it for a .csv.

* * *

Thanks for your help! 😃

edit: well, it seems to work only if the struct is not an array. Any idea 👀 ?

---

<div class="post-metadata">

**Author:** ![MostHost\_LA](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mosthost_la/32/907035_2.png) [@MostHost\_LA](https://forums.unrealengine.com/u/MostHost_LA)\
**Post date:** [February 10, 2024, 10:59pm UTC](https://forums.unrealengine.com/t/struct-to-json/1679567/2 "2024-02-10T22:59:59Z")

</div>

You need to build the thing out with C++ and JSON parsing if you want it to work right with complex jason objects.

Its not difficult, get a lib like newJsoft to do the lifting, create a class that matches the json struct, parse the data into the class, make the node that does the parsing and returns the class values avaliable as a blueprint scriptable node.

Then your team can build any jstruct you like, the output of it is always going to be within the pre-set class type.

Ocf, if you create a custom class and have your team set the variables of that class instead you get a somewhat similar result.  
An array of class entities would do pretty much what you are after…

---

<div class="post-metadata">

**Author:** ![Herlehos](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/herlehos/32/899268_2.png) [@Herlehos](https://forums.unrealengine.com/u/Herlehos)\
**Post date:** [February 11, 2024, 10:40am UTC](https://forums.unrealengine.com/t/struct-to-json/1679567/3 "2024-02-11T10:40:29Z")

</div>

Hi, I have managed to do what I wanted without using the json 😃

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/d/f/ddfadeb79507621acbbc0b5a4285361a6a9d31e0.png)

I’m kind of formatting a json at runtime, then using the node “fill data table with json string” to automatically update my data table!

Thanks for your help anyway 😄

---

<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:** [March 12, 2024, 10:40am UTC](https://forums.unrealengine.com/t/struct-to-json/1679567/4 "2024-03-12T10:40:52Z")

</div>

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