Javascript to complete surveys in survey123 automatically

151
1
08-04-2021 03:38 PM
Jcordovafredes
Occasional Contributor

Hello everyone, I have a specific question regarding javascript, I was watching the following video (60) Working with Custom JavaScript Functions in ArcGIS Survey123 Forms - YouTube minute 7 approximately in which javascript is used, in which when selecting a location it fills in certain fields automatically

I think the importance of the code lies in the following part:

Jcordovafredes_0-1628116308172.png

For me the most relevant thing is to be able to work with points, polygons and lines and I think that changing the geometryType and spatialRel is a good way, but I'm not sure yet

Would you like to know how to explain this process for points and lines?

Tags (2)
0 Kudos
1 Reply
ZacharySutherby
Esri Regular Contributor

Hello @Jcordovafredes

The parameters outlined in the code from the screen capture setup the request to query the feature service. How the other questions are being auto filled is by using pulldata("@json") extracting specific pieces from the response of the query request. 

For more information on using points in JavaScript requests please check out the JavaScript sample available in ArcGIS Survey123 Connect and Ismael's JavaScript functions in Survey123 Esri Community blog

0 Kudos