I have several surveys that receive pass-through attribute information from existing features on other layers. All of the attribute information is populating in Survey123 perfectly well, but I can't get the ¢er function to work. I either get a point off the west coast of Africa or one right where the survey was submitted. Never on top of the existing feature.
I'm using Survey123 Connect version 3.7.62 and ArcGIS Enterprise/Portal 10.6.1. Before migrating to Enterprise, this process worked very well in ArcGIS Online.
Here's an example of my custom URL:
arcgis-survey123://?itemID=xyz&field:Comments={maplocation}&field:Date={installdate}¢er={expression/expr0},{expression/expr1}
expr0:
var originShift = 2.0 * PI * 6378137.0 / 2.0;
var lon = (Geometry($feature).x / originShift) * 180.0;
var lat = (Geometry($feature).y / originShift) * 180.0;
lat = 180.0 / PI * (2.0 * Atan( Exp( lat * PI / 180.0)) - PI / 2.0);
return lon;
expr1:
var originShift = 2.0 * PI * 6378137.0 / 2.0;
var lon = (Geometry($feature).x / originShift) * 180.0;
var lat = (Geometry($feature).y / originShift) * 180.0;
lat = 180.0 / PI * (2.0 * Atan( Exp( lat * PI / 180.0)) - PI / 2.0);
return lat;