FME Transformers: 2026.2 BETA

Categories
Format Specific
Web

Web

JSONObjectBuilder

Builds a JSON object from feature attributes, or inserts attribute values into an existing JSON object.

The transformer operates in one of two Build Modes:

  • Create new JSON Object: Constructs a new JSON object on each feature.
  • Insert into Existing JSON Object: Inserts attribute values into an already existing JSON object at the location specified by the JSON Pointer to Insert Location parameter.
    If the key matching the final token in the pointer does not exist at the specified location, the transformer will create that key and initialize it as a new object before inserting the attribute values.

JSON Pointers

A JSON pointer is a simple mechanism to refer to values within a JSON document. It is defined by RFC 6901 and consists of a sequence of tokens separated by forward slashes (/). Each token selects an object key or array index. An empty JSON Pointer refers to the root JSON value. For example, given the JSON document:

 

Copy
{
  "metadata": {
    "title": "Value List",
    "count": 2
  },
  "items": [
    { "id": "a", "label": "Alpha", “tags”: [2, 7] },
    { "id": "b", "label": "Bravo", “tags”: [3, 4] }
  ]
}

The following JSON Pointers evaluate as:

“”

The entire object

“/metadata”

{ "title": "Value List", "count": 2 }

“/metadata/count”

2

“/items/0”

{ "id": "a", "label": "Alpha", “tags”: [2, 7] }

“/items/1/tags”

[3, 4]

The JSON pointer is used by this transformer to select the target JSON object where selected attributes will be inserted as key-value pairs.

In Insert into Existing JSON Object mode, the pointer must identify an existing object, or a location where an object can be created at the final token. Otherwise the insert location is considered unresolvable (for example, when the pointer refers to an array or non-object value) and the key value pairs will not be inserted.

For more details, see JSON Pointer to Insert Location.

See JavaScript Object Notation (JSON) Pointer at the IETF (RFC 6901).

Usage Notes

  • To append values to a JSON array, use the JSONAppender.
  • To assemble larger JSON documents, combine the JSONObjectBuilder with the JSONAppender.

Configuration

Input Ports

Output Ports

Parameters

Editing Transformer Parameters

Transformer parameters can be set by directly entering values, using expressions, or referencing other elements in the workspace such as attribute values or user parameters. Various editors and context menus are available to assist. To see what is available, click beside the applicable parameter.

For more information, see Transformer Parameter Menu Options.

Reference

Processing Behavior

Feature-Based

Feature Holding

No

Dependencies None
Aliases  
History  

FME Online Resources

The FME Community and Support Center Knowledge Base have a wealth of information, including active forums with 35,000+ members and thousands of articles.

Search for all results about the JSONObjectBuilder on the FME Community.

 

Examples may contain information licensed under the Open Government Licence – Vancouver, Open Government Licence - British Columbia, and/or Open Government Licence – Canada.