Skip to main content
New

JSONUpdater – How to insert an empty JSON object ({}) instead of string or null?

  • November 27, 2025
  • 1 reply
  • 17 views

roghayeh
Contributor
Forum|alt.badge.img+4

Hi everyone,

I’m working with the JSONUpdater transformer in FME and need to add a key called layerDefinition to my JSON. The goal is to have:

"layerDefinition": {}

as an actual empty object, not:

"layerDefinition": "{}" // string

or

"layerDefinition": null

Here’s what I tried:

  • Value Type = Plain Text, Value = {} → Result is "{}" (string).
  • Value Type = JSON/XQuery, Value = {} → Result is null.
  • Value Type = JSON/XQuery, Value = json:object() or map {} → The key doesn’t appear at all in the output.

My JSON path is correct (json["operationalLayers"][0]), and the update type is Insert into Object.

Question:
Is there a way in FME to insert an empty JSON object using JSONUpdater without resorting to a string or null? Or is the only workaround to use AttributeCreator + JSONFragmenter or JSONTemplater?

Any advice or examples would be greatly appreciated!

1 reply

ebygomm
Influencer
Forum|alt.badge.img+46
  • Influencer
  • November 27, 2025

Have you tried this?

Another option is to put {} in an attribute then use that as the value