A JSON object is a collection of named fields — for example {"name": "Sam", "age": 42}. Each field has a name (sometimes called a key) and a value. The nodes on this page let you build objects, set or read fields by name, inspect them, and turn them into plain text you can store, send, or print.
What's on this page
Create — start a brand-new object, either empty or from a piece of text.
Set a field — add or change a named field on an object (one node per value type).
Read a field — pull the value of a named field back out (one node per value type).
Inspect — list every field's name, or find out what kind of value a field holds.
Convert — turn the whole object into a single piece of text.
About fields: field names are case-sensitive — "Name" and "name" are different. Setting a value on a field that already exists replaces the old value; setting one with a new name adds the field.
Create
Create Json Object
Makes a fresh, empty JSON object. Use this as the starting point when you want to build a record from scratch.
What it does
This node produces a brand-new JSON object with nothing in it: {}. From there you'd typically wire it into one or more Set Json Object Field nodes to fill it with named fields.
Inputs
Port
Type
What to connect
Execute
Trigger
Wire this from the previous node's Execute output. The node only runs when triggered.
Outputs
Port
Type
What you get
Execute
Trigger
Fires after this node finishes. Wire it into whatever should run next.
JsonObject
JSON object
A new, empty object {}.
Tips
Chain it. Wire this node's JsonObject output into the JsonObject input of a Set Json Object Field node to add the first field.
Or start from text. If you already have your data as a string like {"name": "Sam"}, use Create Json Object From String instead.
Create Json Object From String
Reads a piece of text written in JSON object form and turns it into a real JSON object you can work with.
What it does
Useful when the data arrived as text — for example from a file you read, a message someone sent, or a value pasted into a configuration. The node parses the text and gives you back a proper JSON object that the other JSON nodes can use.
Inputs
Port
Type
What to connect
Execute
Trigger
Wire this from the previous node's Execute output.
String
Text
The text to parse. It must look like a JSON object — that is, start with { and end with }, with comma-separated "name": value pairs.
Outputs
Port
Type
What you get
Execute
Trigger
Fires after this node finishes.
String
Text
The same text you passed in (in case the next node needs it as well).
JsonObject
JSON object
The parsed object.
Example
String input
{"name": "Sam", "age": 42}
JsonObject output
{"name": "Sam", "age": 42} — now a real JSON object
Tips
Match the format. If the text is malformed (a missing brace, unquoted field name, extra comma, etc.) the node won't be able to parse it.
Reverse direction. To go the other way and turn an object into text, see Json Object To String further down this page.
Set a field
These seven nodes all do the same thing — set a named field on a JSON object — but each one accepts a different kind of value. Pick the one that matches what you're storing.
If the field already exists on the object, its value is replaced. If it doesn't exist, the field is added. The original object isn't modified; what comes out is a new object with the change applied.
Set Json Object Field (String)
Sets a text field on a JSON object.
What it does
This node takes a JSON object, a field name, and a piece of text, and gives you back a new object with that field set to the text.
Inputs
Port
Type
What to connect
Execute
Trigger
Wire this from the previous node's Execute output.
JsonObject
JSON object
The object to update. Often comes from a Create Json Object node or from a previous step.
Name
Text
The name of the field to set. If the field already exists its value is replaced; if not, it's added.
Value
Text
The text to store under that name.
Outputs
Port
Type
What you get
Execute
Trigger
Fires after this node finishes.
JsonObject
JSON object
The updated object with your field set.
Name
Text
The same name you passed in.
Value
Text
The same text you passed in.
Example
JsonObject input
{"name": "Sam", "age": 42}
Name input
"city"
Value input
"Portland"
JsonObject output
{"name": "Sam", "age": 42, "city": "Portland"}
Set Json Object Field (Number)
Sets a numeric field on a JSON object.
What it does
Same as the text version, but the value being stored is a number. Works with whole numbers and decimals; positive or negative.
Inputs
Port
Type
What to connect
Execute
Trigger
Wire this from the previous node's Execute output.
JsonObject
JSON object
The object to update.
Name
Text
The name of the field to set.
Value
Number
The number to store under that name.
Outputs
Port
Type
What you get
Execute
Trigger
Fires after this node finishes.
JsonObject
JSON object
The updated object with your field set.
Name
Text
The same name you passed in.
Value
Number
The same number you passed in.
Example
JsonObject input
{"width": 800, "height": 600}
Name input
"depth"
Value input
24
JsonObject output
{"width": 800, "height": 600, "depth": 24}
Set Json Object Field (Boolean)
Sets a true/false field on a JSON object.
What it does
Same idea as the other Set variants, but the value being stored is a true/false.
Inputs
Port
Type
What to connect
Execute
Trigger
Wire this from the previous node's Execute output.
Stores a JSON object as the value of a named field — useful for grouping related sub-fields together. The original outer object isn't modified; you get a new object with the nested one attached under your chosen name.
Inputs
Port
Type
What to connect
Execute
Trigger
Wire this from the previous node's Execute output.
JsonObject
JSON object
The outer object to update.
Name
Text
The name of the field to set.
Value
JSON object
The inner object to store under that name.
Outputs
Port
Type
What you get
Execute
Trigger
Fires after this node finishes.
JsonObject
JSON object
The updated outer object with the inner object nested under your field name.
Name
Text
The same name you passed in.
Value
JSON object
The same inner object you passed in.
Example
JsonObject input
{"user": {"id": 7}}
Name input
"config"
Value input
{"dark": true}
JsonObject output
{"user": {"id": 7}, "config": {"dark": true}}
Set Json Object Field (JsonArray)
Sets a field whose value is a JSON array.
What it does
Stores a JSON array (a list) as the value of a named field — useful for fields that hold a collection of related items, like tags, scores, or coordinates.
Inputs
Port
Type
What to connect
Execute
Trigger
Wire this from the previous node's Execute output.
JsonObject
JSON object
The object to update.
Name
Text
The name of the field to set.
Value
JSON array
The array to store under that name. See the JSON Arrays page for nodes that build one.
Outputs
Port
Type
What you get
Execute
Trigger
Fires after this node finishes.
JsonObject
JSON object
The updated object with the array stored under your field name.
Sets a field whose value is a scene node — an object in your SimLab scene like a robot, a part, or a marker.
What it does
Stores a reference to a scene node under a named field. The reference points to the live object — not a copy — so other nodes that read this field later receive the actual scene node.
Inputs
Port
Type
What to connect
Execute
Trigger
Wire this from the previous node's Execute output.
JsonObject
JSON object
The object to update.
Name
Text
The name of the field to set.
SceneNode
Scene node
The scene node to reference under that name. Comes from a node like Get Scene Node or a previous step that produced one.
Outputs
Port
Type
What you get
Execute
Trigger
Fires after this node finishes.
JsonObject
JSON object
The updated object with the scene node reference attached.
Sets a field whose value is a User — a participant in a VR/AR session.
What it does
Stores a reference to a User under a named field. The reference points to the live participant; other nodes that read this field later receive the actual User.
Inputs
Port
Type
What to connect
Execute
Trigger
Wire this from the previous node's Execute output.
JsonObject
JSON object
The object to update.
Name
Text
The name of the field to set.
User
User
The User to reference under that name.
Outputs
Port
Type
What you get
Execute
Trigger
Fires after this node finishes.
JsonObject
JSON object
The updated object with the User reference attached.
These five nodes all pull the value of a single field back out of a JSON object. You pick the field by its name. Each variant returns the value as a specific type — pick the one that matches what you stored.
The object isn't modified — the value is read out, the object stays the same.
Get Json Object Field (String)
Reads one field from a JSON object as text.
What it does
Returns the value of the field with the given name. Use this when that field's value is a piece of text.
Inputs
Port
Type
What to connect
Execute
Trigger
Wire this from the previous node's Execute output.
JsonObject
JSON object
The object to read from. Must not be empty.
Name
Text
Which field to read. Names are case-sensitive.
Outputs
Port
Type
What you get
Execute
Trigger
Fires after this node finishes.
JsonObject
JSON object
The same object you passed in.
Name
Text
The same name you asked for.
Value
Text
The value stored under that name.
Example
JsonObject input
{"name": "Sam", "age": 42, "city": "Portland"}
Name input
"city"
Value output
"Portland"
Get Json Object Field (Number)
Reads one field from a JSON object as a number.
What it does
Returns the value of the field with the given name. Use this when that field's value is a number.
Inputs
Port
Type
What to connect
Execute
Trigger
Wire this from the previous node's Execute output.
JsonObject
JSON object
The object to read from. Must not be empty.
Name
Text
Which field to read.
Outputs
Port
Type
What you get
Execute
Trigger
Fires after this node finishes.
JsonObject
JSON object
The same object you passed in.
Name
Text
The same name you asked for.
Value
Number
The number stored under that name.
Example
JsonObject input
{"width": 1920, "height": 1080, "fps": 60}
Name input
"height"
Value output
1080
Get Json Object Field (Boolean)
Reads one field from a JSON object as a true/false value.
What it does
Returns the value of the field with the given name. Use this when that field's value is a true/false.
Inputs
Port
Type
What to connect
Execute
Trigger
Wire this from the previous node's Execute output.
Reads one field from a JSON object as another JSON object (a nested object).
What it does
Returns the value of the field with the given name. Use this when that field's value is itself a JSON object — for example a sub-section like "config" or "user". Once you have the nested object, the other Read-a-field nodes can read its individual fields.
Inputs
Port
Type
What to connect
Execute
Trigger
Wire this from the previous node's Execute output.
JsonObject
JSON object
The outer object to read from. Must not be empty.
Name
Text
Which field to read.
Outputs
Port
Type
What you get
Execute
Trigger
Fires after this node finishes.
JsonObject
JSON object
The same outer object you passed in.
Name
Text
The same name you asked for.
Value
JSON object
The inner object stored under that name.
Example
JsonObject input
{"user": {"id": 7}, "config": {"dark": true}}
Name input
"config"
Value output
{"dark": true}
Get Json Object Field (JsonArray)
Reads one field from a JSON object as a JSON array (a list).
What it does
Returns the value of the field with the given name. Use this when that field's value is a JSON array.
Inputs
Port
Type
What to connect
Execute
Trigger
Wire this from the previous node's Execute output.
JsonObject
JSON object
The object to read from. Must not be empty.
Name
Text
Which field to read.
Outputs
Port
Type
What you get
Execute
Trigger
Fires after this node finishes.
JsonObject
JSON object
The same object you passed in.
Name
Text
The same name you asked for.
Value
JSON array
The array stored under that name.
Example
JsonObject input
{"sizes": [10, 20], "colors": ["red", "blue"]}
Name input
"colors"
Value output
["red", "blue"]
Inspect
These two nodes don't read a specific field — they tell you about the object's structure. Use them when you don't know in advance what fields the object contains, or when you need to find out what type of value a field holds before reading it.
Get Json Object Names
Gives you the list of field names in the object.
What it does
Returns each field name in the object, one after another. Handy when you want to step through every field using a loop construct or for-each pattern, or when you don't know what's in the object up front.
Inputs
Port
Type
What to connect
Execute
Trigger
Wire this from the previous node's Execute output.
JsonObject
JSON object
The object whose field names you want.
Outputs
Port
Type
What you get
Execute
Trigger
Fires after this node finishes.
JsonObject
JSON object
The same object you passed in.
Names
Text
Each field name in turn.
Example
JsonObject input
{"name": "Sam", "age": 42, "city": "Portland"}
Names output
"name", "age", "city"
Tips
Use with Get. Pair this with one of the Get Json Object Field nodes (or with Get Json Field Type) to inspect every field in turn.
Empty objects. If the object has no fields, no names are produced.
Get Json Field Type
Tells you what kind of value a named field holds.
What it does
Returns the type of the field's value as a short piece of text: "String", "Number", "Boolean", "JsonObject", or "JsonArray". Use this when an object's fields can hold different kinds of values and you need to decide which Get node to use.
Inputs
Port
Type
What to connect
Execute
Trigger
Wire this from the previous node's Execute output.
JsonObject
JSON object
The object containing the field. Must not be empty.
Name
Text
Which field to check.
Outputs
Port
Type
What you get
Execute
Trigger
Fires after this node finishes.
JsonObject
JSON object
The same object you passed in.
Name
Text
The same name you asked for.
Type
Text
The type of the field's value, as a short name.
Example
JsonObject input
{"name": "Sam", "age": 42, "active": true}
Name input
"age"
Type output
"Number"
Convert
Json Object To String
Turns the entire object into a single piece of text.
What it does
Produces a text representation of the whole object, written in JSON form. Useful when you need to save the object to a file, send it to another system, or put it somewhere that only accepts text.
The original object isn't modified — you get the same object back plus a text version.
Inputs
Port
Type
What to connect
Execute
Trigger
Wire this from the previous node's Execute output.
JsonObject
JSON object
The object to convert.
Outputs
Port
Type
What you get
Execute
Trigger
Fires after this node finishes.
JsonObject
JSON object
The same object you passed in.
Result
Text
The text version of the object.
Example
JsonObject input
{"name": "Alice", "score": 95}
Result output
'{"name": "Alice", "score": 95}'
Tips
Reverse direction. To go back from text to an object, use Create Json Object From String at the top of this page.
Related
JSON Arrays — the matching page for working with ordered lists of items.
No Comments