Calling external URL from Survey123 form

1161
2
05-11-2021 05:35 PM
GordonSumerling
Esri Contributor

I have a question about calling external URLS from ArcGIS Survey123 that I other have tried. I have been looking at the help files and community forums but cannot find any examples.

What I want to do is from within a Survey:

  1. Populate a early questions in the first part of the form
  2. Capture these answers and concatenate  them into a URL string. This URLS string is an external API from another system
  3. Call this formed URL to the API 
  4. Populate additional fields in the Survey123 form based on the return from the URL call

I believe this type of request is possible from ArcGIS Survey123 but I cannot find examples. If anyone has done this sort of reach out to another system I would be interested.

Tags (3)
0 Kudos
2 Replies
zkovacs
Occasional Contributor III

Hi Gordon,

It depends on what the API returns. If it's a simple response (ie. geocoding result from a geocoder/locator for example what3words), then you can use the pulldata@ function to implement it. If the response is more complex (eg. a JSON), you need to parse that (using a JavaScript code) to be able to add the values to the required fields in your form.

I hope this helps.

0 Kudos
GordonSumerling
Esri Contributor

Thank you zkovacs, I actually found a good article by @IsmaelChivite after posting  this question Custom JavaScript functions in Survey123 (esri.com) 

This describes what I need to do and also there is sample in the Survey123 connect which helps 

GordonSumerling_0-1620861538418.png

Cheers

Gordon

 

0 Kudos