image.png

Category: Objects Kind: Operation Description: Construct an object

Inputs

Name Abbreviation Type Access Description
Existing E Object Item Existing object to add to
Data D Object List The data to add to the object, as a list of key-value pairs

Outputs

Name Abbreviation Type Access Description
Object O Object Item The constructed object

About

In JSON (JavaScript Object Notation), an object is a collection of key-value pairs.

It’s wrapped in curly braces { }, and each key-value pair inside it follows this format:

json
CopyEdit
"key": value

Example:

Here’s a JSON object representing a property listing:

json
CopyEdit
{
  "address": "123 Maple Street",
  "price": 450000,
  "bedrooms": 3,
  "bathrooms": 2,
  "square_feet": 1800,
  "status": "For Sale"
}

Explanation:

Quick Facts About JSON Objects:

JSON Object vs JSON Array:

Example with Both:

json
CopyEdit
{
  "listings": [
    {
      "address": "123 Maple Street",
      "price": 450000
    },
    {
      "address": "456 Oak Avenue",
      "price": 525000
    }
  ]
}

How-to

  1. Feed in an existing object.

    This could be from a panel or the result of another node

  2. Feed in a list of key-value pairs to add to the object

    This could be from a panel or the result of another node

  3. The result is the object and the key-value pairs wrapped as an object