JSONExtractor
Extracts portions of JSON (JavaScript Object Notation) formatted text into feature attributes.
Parameters
The JSON Attribute parameter identifies the feature attribute which contains the JSON text.
This parameter identifies the feature attribute into which the result of the JSON query should be put.
This parameter is the JSON query whose value will be stored in the target attribute.
A JSON query is primarily used to refer to values in some JSON text. They can also be used to extract some metadata about the JSON text, such as the type (object, array, string, etc.) of JSON value or the number of elements in an array. The outermost JSON value, which must be an object or an array, is always referred to by the term "json". Contained values can be referred to using JavaScript-like square bracket index operators.
A value in an array can be referred to using its zero-based position in the array (for example, json[2] for the third element).
A value in an object can be referred to using its object key name
json["key"]
All of the values in an array or object can be collectively referred to using a wildcard index
json[*]
The query used by this transformer can have multiple expressions, which are separated by a '+' operator, as well as string literal values. This allows more complex attribute values to be easily created from the JSON text. For example:
json["name"]["first"] + " " + json["name"]["last"]
The JSONFragmenter transformer contains more information on JSON queries.
If the JSON query cannot be fully evaluated, a message will be logged, and the feature will be output without setting the target attribute.
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
FME Licensing Level
FME Professional edition and above
Search FME Knowledge Center
Search for samples and information about this transformer on the FME Knowledge Center.