I have previously created workflows where URL parameters are passed from a popup link (in web map or Field Maps) and launches Survey123 field app, pulling information like coordinates, address, and business name. Perhaps something has changed recently or I am missing a step, but I am trying to create a similar workflow in the Survey123 Web App and the center parameter is not centering the geopoint question.
I have seen other posts about using URL Encode to format the text before constructing the URL, which I have done. The coordinates (derived from 2 Arcade expressions in the popup) are being passed correctly but the geopoint question is not centering on the coordinates. Is this expected behavior for the Survey123 web app or have I missed something else? I also saw a mention of making the geopoint question required, but that has not remedied the situation either.
Expression:
//Latitude
var y = Centroid($feature).y
var originShift = 2.0 * PI * 6378137.0 / 2.0;
var lat = (y / originShift) * 180.0
lat = Round(180.0 / PI * (2.0 * Atan( Exp( lat * PI / 180.0)) - PI / 2.0), 6)
//Longitude
var x = Centroid($feature).x
var originShift = 2.0 * PI * 6378137.0 / 2.0;
var lon = Round((x / originShift) * 180.0, 6)
var coordinate = lat + "," + lon
var business = $feature.PLACENAME
var urlsource = "https://survey123.arcgis.com/share/db33d329a1a1496da93e18f2d3eff601?"
var params = {
center: coordinate,
"field:busname": business,
}
return urlsource + UrlEncode(params)
Returns:
URL and Geopoint question center don't match:
Solved! Go to Solution.
Took forever to find where I did this...
For the geopoint, set default to null
EDIT: I don't have required set for my geopoint, but I have seen others say that it may help.
Took forever to find where I did this...
For the geopoint, set default to null
EDIT: I don't have required set for my geopoint, but I have seen others say that it may help.
That solved it, thanks for the advice!