LogoLogo
API Status
  • 👋Welcome
  • 🌐What is Morpheus Platform?
    • Interoperability
  • â„šī¸Help
    • 📗Glossary
    • 🆘Support
    • Firewall problems
    • EULA
  • CREATION
    • 🎮Unreal Development
      • ⚡Get Started
        • âš’ī¸Download the Editor
        • âĢUpload Content
        • 🌎Creating your own map
        • 📝Morpheus Base Project
        • ❓Differences from Unreal
          • 🧍Character Configuration
        • 📡Morpheus Networking
          • Introduction to Morpheus Networking
          • Network Levels
          • Replicated Properties
          • RPCs
          • Morpheus Render Targets
          • Morpheus Array
          • Networking FAQ
          • Replicating Sublevels
      • 📚Features & Guides
        • 📒Example Plugin
          • Nameplates
          • In-game roles
          • Resizing
        • 🏊Actor Pooling
        • 🔊Audio
        • 🎭Avatars
          • Creating an Avatar
          • Attachments
            • MML Attachments
          • Custom Animation Variables
          • Importing an NFT collection
          • Capsules and Mesh Transforms
        • 🤖Bots
        • đŸŽ™ī¸Chat
          • Unreal Text Chat
        • đŸŽ›ī¸Control Panels
          • Control Panel Configuration
          • DJ booth mission control
          • Observer Controls
        • 🔉Crowd Audio
        • đŸ¤ŧCrowd Rendering
          • Legacy Animated Crowd
            • Animated Crowd Console Commands
            • Attaching static meshes to crowd members
          • Crowd Materials
          • Performance Parameters
          • Live Config Settings
          • Crowd Animation
            • Crowd Anim Blueprint
              • User Guide - Crowd Anim Blueprint
              • Reference Guide - ABP Nodes
                • Animation Playback
                • States and State Machines
                • Variables
                • Transitions
                • Special
                • Blends
                • Additional Notes
        • 🍱Helpers & Extras
          • "Instanced Objects" in Blueprints
          • Objects with "world context"
          • Making DataAsset classes
          • Duplicate Objects
          • The Bootflow Subsystem
          • The "Wait For Condition" System
          • Advanced Graphics settings
          • Listening to inputs on UObjects
          • Morpheus UserID
          • World Services
          • M2Extras: Skins System
        • đŸ–Ĩī¸Loading Screen
        • ⚡Live Config
          • Editing for a World
          • Editing Locally
          • Default Settings
          • Accessing via Blueprint
          • Adding New Settings
          • Overriding Defaults
          • Using Arrays
        • 🧊MML
        • đŸ•ēMotion Capture
        • 📡Networking
        • đŸ“ĸNotifications
        • Raycastable Crowd
        • 🌐Singletons
        • 📱Streaming & Multiplatform
          • GFN on mobile
        • đŸ–Ĩī¸UI
          • "UI Mode"
        • đŸ—ƒī¸User Collections
          • Creating a New Object Definition
          • Accessing from Unreal
            • Creating Objects Definitions
            • Transfer Objects
            • User Collection Views
            • Receiving Updates
        • đŸ“ēVideo Players
          • Embedded Video Player
          • Millicast video streaming
            • How to Setup an In-Game Video Stream
            • Picture-in-Picture mode
          • Streaming Video Player
            • How to Setup a URL Video Player
            • Picture-in-Picture mode
        • 🐞Visual Debugging
          • Inspector
        • đŸĒŸWeb UI
        • Online Services
          • KV Store Service
        • 💠Web Requests
          • Http Requests
            • Legacy HTTP Nodes
          • JSON Handling
          • WebSockets
          • Identity Validation
          • Allowed External URLs
          • Walkthrough Example
            • Example Counter Service
        • âœˆī¸World Travel
          • World Travel in the editor
        • Avatar Physics Assets
        • Action Gameplay Helper Components
      • 🔑Workflows
        • â†—ī¸Upgrade the Editor
          • đŸ–Ĩī¸Version History
        • âš™ī¸Editing Project Settings
        • 📈Profiling
        • đŸ§ēMarketplace Importing
        • đŸ› ī¸Extra Workflows
          • Setup Play-in-Editor
          • Setup Local Asset Validation
          • Adding Gameplay Tags
          • Validating Game Assets
          • Custom Connection Modes
          • Connect Editor to a World
          • Common Issues
      • 📚Useful Reading
        • ⭐Best Practices
    • 🌎Worlds
      • 📩Invite Players
        • Setting Role Groups
      • Persistent Worlds
      • Always on Worlds
    • 📅Running events
      • ✅Large scale events - Checklist
      • 👾Anti-Cheat (EAC)
      • 🎮Player Entry
        • 📱React Native
        • Steam
        • đŸ’ģHardware Reqs
      • đŸŽĨBroadcast
        • 📹OBS Integration
      • Failover
      • 🏁Capacity And Queue Management
  • ADMINS
    • đŸ‘ĒAccess Control
      • Adding metaverse contributors
      • Creating a new project
    • 💲Pricing
      • Development Support
      • Included Usage & Overages
      • Cloud Streaming
      • Access Modes
      • War Room Support
      • Platform SLA
    • âš™ī¸Settings
      • đŸ—ƒī¸Projects
  • APIs and Tooling
    • đŸ–Ĩī¸API Reference
      • Accounts
      • Events
      • Key/Value Store
      • Organizations
      • Realtime
      • User Profile
      • World Builder
      • Worlds
    • đŸ’ģTemplate Web App
      • đŸ’ĸModeration
    • Pixel Streaming
    • 🚀Launcher
  • Integrations
    • 📊Analytics
      • Sending events from web
      • 🎮Sending Events from Unreal
    • đŸ’ŦChat
      • 🎮Integrating Pubnub with your Unreal Project
      • Adding Moderation to Chat
Powered by GitBook
On this page
  • JSON Blueprint Utilities
  • To / From String
  • Get / Set Fields
  • Field Inspection
  • M2 JSON Utilities
  • To / From UStruct
  • Nested Objects
  • To Map
  • JSON Value Handling
  • JSON Values
  • JSON Arrays
  • JSON Objects

Was this helpful?

  1. CREATION
  2. Unreal Development
  3. Features & Guides
  4. Web Requests

JSON Handling

Working with Json from Blueprints

PreviousLegacy HTTP NodesNextWebSockets

Last updated 7 months ago

Was this helpful?

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.

M2 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

{
    "person": {
        "forename": "alice",
        "surname": "smith"
    },
    "contact": {
        "address": {
            "street": "park avenue",
            "town": "exampleville"
        }
    }
}

The path of contact.address would return a Json Object containing:

{
    "street": "park avenue",
    "town": "exampleville"
}

To Map

This node allows you to read all fields into a specified (pre-made) map of either strings or integers.

JSON Value Handling

These features are only available in V28 onwards

In V28 we have added a range of improvements that allow working with JSON at a deeper level than Objects. These are exposed as a set of JSON Value functions.

JSON Values

There are a series of functions available to create the main JSON Value primiities of Null, Number, String, Array and Object.

Each of these creates a JSON Value that wraps the provided data. You can extract this data from a JSON Value by using the Get Json Value XXX functions, which will return the wrapped data if the type matches.

The Is Json Value XXX functions can be used to test if a JSON Value is the type you want.

Additionally the functions Get Json Value Type and Is Json Value Type are available to query based on the type.

As you would expect; there are a couple of To/From JSON String helpers available.

The Value to Json String function can only work on JSON Values that wrap Arrays or Objects; this is due to a limitation in the built-in Unreal JSON Serializer.

JSON Arrays

There are several ways to create a JSON Array. If you have an array of homogeneous types (eg: all String or all Number, etc) then the Create Json Value XX Array functions will help you.

If you have a heterogeneous list of value types, then the Create Json Value Array function will be best for you. This allows you to add any JSON Value type to an array.

You can also create an Array by using the Json String to Value function, using a Json representation of the array.

In order to access the content of the JSON Array you have a couple of options at present.

Get Json Value Array Items will give you access to an array of the content; essentially unwrapping the array for you to use. You can then iterate on the contents as you would any normal array.

Individual items can be accessed by using the Get Json Array Item Count and Get Json Array Item functions. These return the length of the array and the item at a specific location.

JSON Objects

JSON Objects can be wrapped in JSON Values. In addition to the JSON Object functionality discussed elsewhere, the JSON Value library gives you the ablity to Get or Set fields from an object using the Get Json Object Field Value and Set Json Object Field Value functions.

You can also use the Get Json Value at Location to access a specific value in a JSON Object hierarchy.

For example; given this JSON object

{
    "person": {
        "forename": "alice",
        "surname": "smith"
    },
    "contact": {
        "address": {
            "street": "park avenue",
            "town": "exampleville"
        }
    }
}

The path of contact.address.street would return a JSON Value of type String that contains the string value park avenue. This is useful for accessing individual fields from a nested hierarchy.

🎮
📚
đŸ’