I have survey with a custom JavaScript function that fetches a point feature by a user-provided fire incident ID using a pulldata calculation in Survey123 Connect (latest beta version). I'd like to get the attributes and the geopoint location to populate in my survey questions. I have been able to follow the sample provided to get a JSON object and populate my text and date fields but I am struggling to parse the object to extract and populate the geopoint. I reviewed this post on using calculations to get geopoints but I'm not getting the calculation right...
Below is the json feature object I am working with (I used JS to add the geopointCoords property thinking this would work but it didn't help):
{
"attributes": {
"IncidentName": "Beachie Creek",
"POOState": "US-OR",
"POOCounty": "Marion",
"FireDiscoveryDateTime": 1597601880000
},
"geometry": {
"x": -13601905.941048512,
"y": 5593402.744904984,
"geopointCoords": "5593402.744904984 -13601905.941048512"
}
}
Below are a few things I tried in the calculation field to populate the geopoint but both are wrong and result in an Error caused by java.lang.NumberFormatException.
pulldata("@json", ${irwinFeatureData}, concat("geometry.y", " ", "geometry.x"))and
pulldata("@json", ${irwinFeatureData}, "geometry.geopointCoords")If anyone has any insight, I'd be very grateful!