Having issue mapping "many" cardinality data structure to feature service

123
2
Jump to solution
04-26-2021 10:36 AM
MichaelKarikari1
New Contributor II

Attempting to process the an incoming json post but ran into an issue with nested json array.  Im unable to use field mapping to take the nest elements of observations to a flat geodefinition used for a feature service output.

Issue is only with JSON array section, as the nest json for survey result are able to different feature service with flat geodefinition.

Any insight on what I may have wrong or limitations I may be hitting?

MichaelKarikari1_0-1619458587623.png

 

0 Kudos
1 Solution

Accepted Solutions
EricIronside
Esri Regular Contributor

Hey @MichaelKarikari1 

First off there appears to be an error in the JSON array you posted (extra comma at the end of the array data just before the closing ']', but I'll assume that is just an editing error when you created the sample. 

Pulling in a JSON sample similar to yours, I was able to use a field mapper to map the two grouped array values out to a flat schema (see FieldMapper settings below).  But this assumes your array will always be the same size.

EricIronside_0-1619812537566.png

 

If your array is always going to be different sizes or if you would like to convert each array item into a separate event, you will want to use the Multicardinal Field Splitter Processor. This processor element will create a new GeoEvent for each array member, flattening the schema in the process.

View solution in original post

0 Kudos
2 Replies
EricIronside
Esri Regular Contributor

Hey @MichaelKarikari1 

First off there appears to be an error in the JSON array you posted (extra comma at the end of the array data just before the closing ']', but I'll assume that is just an editing error when you created the sample. 

Pulling in a JSON sample similar to yours, I was able to use a field mapper to map the two grouped array values out to a flat schema (see FieldMapper settings below).  But this assumes your array will always be the same size.

EricIronside_0-1619812537566.png

 

If your array is always going to be different sizes or if you would like to convert each array item into a separate event, you will want to use the Multicardinal Field Splitter Processor. This processor element will create a new GeoEvent for each array member, flattening the schema in the process.

View solution in original post

0 Kudos
MichaelKarikari1
New Contributor II

Yup you are correct, the "," is due to the fact that json is only an excerpt of a larger post. And appreciate you pointing me to this processor. This is exactly what I needed!

0 Kudos