Passing Location Information from Zone Lookup Instant App to Survey123

243
4
03-27-2024 01:33 PM
Labels (1)
emoreno
New Contributor III

Hello ESRI community!

I am working on creating a zone lookup instant app where a customer inputs their address and the app returns a popup with a survey123 link if found in the appropriate zone. I was wondering if there was a way to pass the location information from the instant app and into the survey automatically so that a customer does not have to input their address twice, once in the app and once in the survey. Any direction on accomplishing this would be greatly appreciated. Thank you!

emoreno_6-1711571596204.png

emoreno_4-1711571518846.png

emoreno_3-1711571333789.png

 

 

0 Kudos
4 Replies
PaulCone2
Occasional Contributor III

You can build a URL including the address and pass it to the survey, as documented here...

Integrate with other apps—ArcGIS Survey123 | Documentation

0 Kudos
KellyHutchins
Esri Frequent Contributor

The Zone Lookup app displays the popup information that you define in your web map. So you could probably write an arcade expression that constructs the necessary url with location information (lat,lon) appended. 

 

Alternatively we also have an undocumented option in the Zone Lookup app where you can add a link to the custom text that can appear before results, after results or when no results are found. Using these steps you can add a link to those text areas that can open up a url with either the find or center url parameters appended. 

  1. Open the config experience for Nearby or Lookup
  2. Go to the Text config section where you can define the no results, pre results and post results messages.
  3. Click the edit button to open the text editor and enter the source mode by pressing the "Source" button.
  4. Add a link (you could also do this via the link button but you'll still have to edit the source). Here's an example where we have the app url and append the center url param.

 

<a href="https://www.arcgis.com/apps/instant/nearby/index.html?appid=705b775322e2400b9ebcaf8e2820e759&{center}" target="_blank">Link to app center</a>​

 

In the example above the crucial bit is the {center} value. The {center} placeholder will be replaced with the map's center point. You can use find the same way by specifying {find}.
Note that in the example above we add center to the url by adding an ampersand in front of it. This is needed to ensure the parameter is added to the url. In this example we use & because the url already has a first url param added via the question mark. The "operators" section of this article explains when to use ? vs & if you aren't familiar with these options.

Currently we support these placeholder options: 

  • {find} : url will have the find value append (https://www.argis.com?find=Texas)
  • {centerLatLon}: url will have a center url param in the order lat,lon
  • {centerLonLat}: url will have a center url p aram in the order lon,lat

 

We do plan to offer a better configuration experience for these in a future release so any feedback on options you'd like to see supported is appreciated. 

 

 

emoreno
New Contributor III

Hi Kelly, thank you for the insight! Unfortunately I don't think I will be able to use the custom text that appears before the results, as I only want this survey link to appear for specific results rather than any and all results.

I have tested creating a custom arcade expression that has a dynamic url, but believe I am struggling with writing it correctly. I see documentation on how to push the lat lon from a point feature that is selected to a survey, but I would like the URL to pull the lat lon of the address someone inputs from the geolocator, if that is possible. Do you have any additional insight on how to write this or what I may be doing wrong? 

0 Kudos
KellyHutchins
Esri Frequent Contributor

Unfortunately I do not know Arcade all that well. But perhaps someone in the Arcade space in Esri Community can help?

0 Kudos