Field Mapper REST [ ]

224
1
09-19-2024 02:55 AM
Nico9
by
Emerging Contributor

Hello,

I would like to process fields from a REST API in the Field Mapper. That works so far. Unfortunately, some data in REST is configured strangely and I cannot process it in the Field Mapper.

REST URL: https://www.pegelonline.wsv.de/webservices/rest-api/v2/stations.json?includeTimeseries=true&includeC...

So far I know how the following REST code has to be specified in the field mapper:

"water": {

"shortname": "ALLER",

"longname": "ALLER"

},

Field Mapper

water.shortname

water.longname

My problem is the nesting with [ ]:

"timeseries": [

{

"shortname": "W",

"longname": "WASSERSTAND RAHDATEN",

"unit": "cm",

"equidistance": 15,

"currentMeasurement": {

"timestamp": "2024-09-19T11:30:00+02:00",

"value": 259.0,
"stateMnwMhw": "normal",
"stateNswHsw": "unknown"
},
"gaugeZero": {
"unit": "m. ü. NN",
"value": 8.0,
"validFrom": "1985-03-13"
}
}
]

For example, I tried this for the shortname:

timeseries.shortname

and for value:

timeseries.currentMeasurement.value

Both lead to "NULL" values

How do the [ ] have to be taken into account in the field mapper?

Thanks for your advice!

0 Kudos
1 Reply
JeffSilberberg
Frequent Contributor

Am I reading this correctly, you have array's with the json ?

Just use the appropriate Arcade function to process the array. 

https://developers.arcgis.com/arcade/function-reference/array_functions/

https://community.esri.com/t5/developers-questions/parse-data-from-json-in-arcade/td-p/557738

 

 

 

0 Kudos