In my case the JSON has the schema (name, alias and field type of a feature). Shown below.
Sample attached.
I got the schema array in rows.
I have feautes JSON fragmented with json["features"][*]["attributes"] with the following output.
Instead of exposing each attribute one at a time or importing a temporary csv file created by aggregation, i'd like to use the schema from the fields array for the features output.
Hope to get some ideas to use using derived schema in my workflow.
Thanks!
Best answer by takashi
Hi @salvaleonrp, in this case, I think you can apply the dynamic workflow approach described in Dynamic Workflows: Destination Schema is Derived from a Schema Feature. That is, create schema definition (attribute{}.name, attribute{}.fme_data_type) from the JSON "fields" array. You can then merge the list to every feature unconditionally in order to configure dynamic writer feature type.
Note: the original format of "creationdate" seems to be milliseconds since UNIX epoch, so you will have to expose it and convert the format to an appropriate date/time format for the destination data format.
Hi @salvaleonrp, in this case, I think you can apply the dynamic workflow approach described in Dynamic Workflows: Destination Schema is Derived from a Schema Feature. That is, create schema definition (attribute{}.name, attribute{}.fme_data_type) from the JSON "fields" array. You can then merge the list to every feature unconditionally in order to configure dynamic writer feature type.
Note: the original format of "creationdate" seems to be milliseconds since UNIX epoch, so you will have to expose it and convert the format to an appropriate date/time format for the destination data format.
I'm a bit late to the party, but is this possibly some ESRI-flavored JSON? What happens if you try reading it with the "Esri-JSON (Esri JavaScript Object Notation)" reader?
I'm a bit late to the party, but is this possibly some ESRI-flavored JSON? What happens if you try reading it with the "Esri-JSON (Esri JavaScript Object Notation)" reader?
It is a json response to a ArcGIS Server capability called Export Subnetwork.
I used the ESRI-JSON format reader but all it does is flatten the features array into attributes- which does it very well. However, I need to use another array in the same json called "fields" for sourceMapping actual values of the features' attributes, e.g. fromnetworksourceid --> sourceAlias; layerId --> featureLayerName.
Also, my Json Url queries have a lot of parameters to make it practical to use the ESRI-JSON reader.
We use 3 different kinds of cookies. You can choose which cookies you want to accept. We need basic cookies to make this site work, therefore these are the minimum you can select. Learn more about our cookies.