Select to view content in your preferred language

Passing Location Information from Zone Lookup Instant App to Survey123

1142
10
03-27-2024 01:33 PM
Labels (1)
emoreno
Regular Contributor

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
10 Replies
PaulCone2
Frequent Contributor

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
Alex_Blenkush
Emerging Contributor

Hello, 

Do you have an example of how to construct the URL to pass the "find" value (i.e. address string) from zone lookup, that then auto-populates the address in a text Survey123 question?

Thanks

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
Regular Contributor

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
Alex_Blenkush
Emerging Contributor

Hi Kelly, 

Do you know if the {find} results (e.g. an address) from Zone Lookup can be pushed automatically to a Survey123 form, inputting the address in a question so the user doesn't have to type it once in Zone Lookup and then again in Survey123? Thanks.

0 Kudos
KellyHutchins
Esri Frequent Contributor

Do you want to display a link someplace in the app that users can click and open the survey?

0 Kudos
Alex_Blenkush
Emerging Contributor

Hi Kelly, 

Yes. The link takes them to a web survey123 form and auto-populates a text question using the {find} value from the zone lookup app. Since yesterday I actually got this to mostly work, except my Survey123 text question is populated like this" "find= 123 main street....". So, the only part I'm missing is how to remove the "find=" part of the string from the Survey123 question.

zone lookup: user enters address/clicks map 

Alex_Blenkush_0-1747168702331.png

a survey hyperlink appears that navigates them to survey123 web form. The expression I use for the link is this: <a href="https://survey123.arcgis.com/share/8d9375aa2dcd44d697ec06923ef089d6?field:property_address={find}">Open survey</a>

The {find} address transfers to my Survey123 question, however "find=" is carried along with it:

Alex_Blenkush_1-1747168990792.png

Hopefully this is a simple fix!

 

0 Kudos
KellyHutchins
Esri Frequent Contributor

Unfortunately there isn't an approach right now that lets you remove the find= portion of the value on the instant app side. Not sure about the Survey 123 side.

In the next release of ArcGIS Online due out later this year you can use findParam instead of find in your url link and it will insert just the value not the find= portion .

0 Kudos
Alex_Blenkush
Emerging Contributor

Thanks, Kelly. Good to know about the upcoming release of AGOL.

0 Kudos