Javascript function working in Survey123 field app but not browser

895
4
Jump to solution
07-30-2020 12:59 PM
BrandonUnderwood1
New Contributor II

Hello!

I have created a javascript function to run in Survey123 Connect based on an example found on ESRI Events YouTube channel (Extending the Survey123 Field App - YouTube ). This function allows an infrastructure zone to be calculated based on the location of the device/selection on the map. It works perfectly in Survey123 Connect, publishes fine and works on the Survey123 App however once I open the survey on the web I get an error:

Error: Initializing form...

Failed to load data from jr://file-csv/@javascript.csv

I have attached a Survey Design folder which is a simple example with which I am having the same issue. 

Any help is greatly appreciated! Thank you!

Brandon

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
Philip-Wilson
Esri Notable Contributor

Hi Brandon,

JavaScript functions have been beta until version 3.10 of Survey123. If you are using Connect to publish your survey, you need to publish with Connect 3.10 to ensure the web app will work as expected. Connect 3.10 will be released later this week. Otherwise, you can try turn off version locking in the survey123 website for your survey, to ensure it is using 3.10 web app.

Regards,

Phil.

View solution in original post

4 Replies
Philip-Wilson
Esri Notable Contributor

Hi Brandon,

JavaScript functions have been beta until version 3.10 of Survey123. If you are using Connect to publish your survey, you need to publish with Connect 3.10 to ensure the web app will work as expected. Connect 3.10 will be released later this week. Otherwise, you can try turn off version locking in the survey123 website for your survey, to ensure it is using 3.10 web app.

Regards,

Phil.

BrandonUnderwood1
New Contributor II

Hi Phil,

I've republished using Connect 3.10 and the error stopped popping up however the value is not populating in the web version. Everything is continuing to work in the App though.

Thank you,

Brandon

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Hi Brandon,

One additional thing to note - the name of the directory used to store the javascript changed from 'extensions' to 'scripts' during the beta process.  Refer to the 3rd paragraph in JavaScript functions in survey forms—ArcGIS Survey123 | Documentation 

BrandonUnderwood1
New Contributor II

Thanks James! That did the trick. 

Brandon