Hello,
I am trying to pass the centroid of a feature from the Field Maps field app to the Survey123 field app through the URL parameters. I have poached the following arcade expressions to find the lat/lon:
var originShift = 2.0 * PI * 6378137.0 / 2.0;
var lat = (Centroid($feature).Y / originShift) * 180.0;
lat = 180.0 / PI * (2.0 * Atan( Exp(lat * PI / 180.0)) - PI / 2.0);
return lat
var originShift = 2.0 * PI * 6378137.0 / 2.0;
var lon = (Centroid($feature).X / originShift) * 180.0
return lon
then pass that in to my URL parameter as "...&?center={expression/expr0},{expression/expr1}"
When I test these expressions in the arcade dialogue they return the correct coordinates, but the geopoint is still centered on my iPad's location when it opens Survey123. I was wondering if this is because my geopoints are in a repeat group, or if there are some known bugs when the geopoints are in a repeat, like it has to go to the 'name' field in the XLSform or something?
The points are collecting land use information on a single parcel of land so it would be ideal to keep it to one survey submission per parcel. I would like to have each new record start at the centroid, then the user can move it around to collect the specific survey data on the parcel. My geopoint question is set to required, and I built the survey in Connect. Not sure how much info to supply but I'm happy to provide more if necessary!
Unrelated, but I'm also having trouble with the callback function to return to the Field Maps app once I submit the survey. It's written this way at the moment: "...&callback=fieldmaps.arcgis.app://" in the parameters, but to no avail.
Any help is appreciated, thanks!