JSONFlattener
Flattens JSON (JavaScript Object Notation) objects, extracting the object keys and values into FME feature attributes.
For example, consider a feature which has an attribute named json containing the following text:
{ "paramName":"GeocodeResult", "dataType":"GPFeatureRecordSetLayer", "value": { "geometryType":"esriGeometryPoint", "spatialReference": {"wkid":4326 } } }
After going through the JSONFlattener, the following attributes will have been added to the feature:
Attribute Name | Attribute Value |
---|---|
paramName | GeocodeResult |
dataType | GPFeatureRecordSetLayer |
value.geometryType | esriGeometryPoint |
value.spatialReference.wkid | 4326 |
Output Ports
Features which are successfully processed will be output through this port.
Features which could not be successfully processed will be output through this port. Typically this happens when the attribute specified in the JSON Attribute parameter does not have a value, or has a value that is not valid JSON.
Parameters
The JSON Attribute parameter identifies the feature attribute that contains the JSON text.
If this parameter is set to No, each JSON object key will become an attribute and the corresponding JSON value will become the attribute value. If this parameter is set to Yes, only object values which are simple types (integers, strings, etc) will become attribute values, while nested objects and arrays will be recursively flattened, as shown in the above example.
This parameter may be used to provide a string with which to prefix the newly-created attributes.
Exposes any attributes so they can be used by other transformers. Type directly in the text box or click the browse button to display the editor and add attributes there.
FME Licensing Level
FME Professional edition and above
Editing Transformer Parameters
Using a set of menu options, transformer parameters can be assigned by referencing other elements in the workspace. More advanced functions, such as an advanced editor and an arithmetic editor, are also available in some transformers. To access a menu of these options, click beside the applicable parameter. For more information, see Transformer Parameter Menu Options.
Transformer Categories
Search FME Knowledge Center
Search for samples and information about this transformer on the FME Knowledge Center.