Survey 123 - Looking for an example of editing a feature service with a custom js

445
1
01-15-2021 12:16 PM
ScottLehto3
Occasional Contributor

Hi, I am starting a project and i need to edit a feature service with custom JS. So i am looking for a good starting point/example.

 

Looking to see how the app needs to be structured, what file names are necessary, and how to associate js code with attribute change events. Just the basics of editing. Figure i would ask before going crazy...lol.

 

 

0 Kudos
1 Reply
ZacharySutherby
Esri Regular Contributor

Hello @ScottLehto3

Please use this link for more information on getting started with JavaScript functions in ArcGIS Survey123. To edit a feature service your JS function will need to send an applyEdits request. I would suggest using a web debugging proxy like Fiddler to look at the applyEdits request that Survey123 sends when submitting data. From there you can download an API development program called Postman to test formatting and sending applyEdits requests to your feature service. Once you have that set up and it's working as you would expect Postman has a fancy feature that allows you to copy the request as a code snippet and one of the options is JavaScript XHR which is what you will need for your Survey123 JavaScript function. 

ZacharySutherby_0-1633130611270.png

 

 

Thank you,
Zach
0 Kudos