Hi Jessica Ridout
The reversegeocode.address.Match_addr bit of the pulldata function refers to the output of your locator. When using the Esri World Geocoding service, the output of the locator looks something like this:
{
"address":{
"Match_addr":"570 St Kilda Rd, Melbourne, Victoria, 3004",
"LongLabel":"570 St Kilda Rd, Melbourne, Victoria, 3004, AUS",
"ShortLabel":"570 St Kilda Rd",
"Addr_type":"PointAddress",
"Type":"",
"PlaceName":"",
"AddNum":"570",
"Address":"570 St Kilda Rd", "Block":"",
"Sector":"",
"Neighborhood":"Melbourne",
"District":"",
"City":"Melbourne",
"MetroArea":"",
"Subregion":"",
"Region":"Victoria",
"Territory":"",
"Postal":"3004",
"PostalExt":"",
"CountryCode":"AUS"
},
"location":{
"x":144.97914150000003,
"y":-37.847384999999996,
"spatialReference":{
"wkid":4326,
"latestWkid":4326
}
}
}
With a custom locator, the response will be different, so you need to adjust your pulldata function accordingly.
The easiest way to figure things out is to:
1- Create a text question in your survey. Set the esriFieldLength value in your XLSForm to a very high number such as 50000. Also set the esriFieldType to null so the JSON is never written into the feature layer.
2- In the calculation for this new text question add something like this:
pulldata("@geopoint",${location},"reversegeocode")
3- Now run your survey and look at the output JSON string you get. Put the text into JSONLint - The JSON Validator or some other JSON formatter utility.
4- Construct your new pulldata function accordingly and remove the question you added in step 1 if you no longer needed.
For reference, check https://community.esri.com/groups/survey123/blog/2018/07/06/understanding-reverse-geocoding-in-surve... if not already.