JSON Handling
Working with Json from Blueprints
Some of these features are only available in V27 onwards
To work with HTTP / WebSockets effectively, you'll often need to manipulate JSON data from Blueprint.
To facilitate this, we have enabled Epic's JsonBlueprintUtilities
plugin which offers a collection of nodes for manipulating Json Objects. In addition, we have provided an extended set of nodes to augment the out of the box features that Epic provide.
Json Blueprint Utilities
Epic's JsonBlueprintUtilities
plugin offers several useful features:
To / From String
Load Json From String
This can take a JSON string and convert it to a JSON Object
Get Json String
Converts a JSON Object to a JSON string
Convert Struct to Json String
Converts a UStruct directly to a JSON string
Get / Set Fields
The Get Field
node allows you to retrieve a specific field from a JSON Object. The return value is a wildcard and so requires explicitly casting or connecting to an input pin.
The Set Field
node allows you to set a specific field on a JSON Object with a wildcard typed field.
Internally this relies on Unreal's Json Serializer, so if a wildcard type is not explicitly serializable to/from Json you may end up with unexpected failures or results.
Field Inspection
Has Field
Allows you to inspect if a Json Object has a specific field.
Get Field Names
allows you to list all the field names on an object; which can then be used to enumerate them in a loop.
JSON Utilities
We have augmented Epic's nodes with some of our own to further facilitate working with JSON data.
To / From UStruct
Make Json Object from Struct
Converts any UStruct to a JSON object.
Make Struct from Json Object
Converts a JSON object into a struct of a specific, known type
Read Json Object into struct
Uses an existing struct (eg: in a variable) to read a JSON object
Nested Objects
Get Json Object at Location
Allows you to specifiy a dot.delimited.path
to a field containing a JSON object.
For example; given this JSON object
The path of contact.address
would return a Json Object containing:
To Map
This node allows you to read all fields into a specified (pre-made) map of either strings or integers.
Last updated