Select to view content in your preferred language


10-21-2020 03:30 PM
New Contributor II

Hello. I built a form with Survey123 Connect that's using pulldata("@geopoint",${location},"reversegeocode.address.Match_addr","CustomLocatorURL") to fill in the address for a question automatically. Works great! What I can't figure out is how to use the same method to pull other information from a locator, like City Council District or Neighborhood. Is that possible? Is the Match_addr field the only field this can pull, or is there a way to make it pull another field, like City or State?

I've tried every locator style that uses polygon data, Single House, Zip, City State, Gazatteer, but it doesn't seem to work with area locators, only point or line. Is there another way to automatically fill in information about a point location from the geopoint question? 

Tags (2)
0 Kudos
1 Reply
Esri Notable Contributor

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:

               "Match_addr":"570 St Kilda Rd, Melbourne, Victoria, 3004",
               "LongLabel":"570 St Kilda Rd, Melbourne, Victoria, 3004, AUS",
               "ShortLabel":"570 St Kilda Rd",
               "Address":"570 St Kilda Rd",        "Block":"",

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:


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 if not already.