I want to understand how to incorporate a JavaScript function into Survey123. I've read this post: CHALLENGE: JavaScript functionality · Issue #144 · tedrick/Survey123-Testing · GitHub and my goal was just to make something really simple. I created the extensions directory inside my survey folder. I created a JS file, MyJSFunctions, with one function:
function lastName(FullName){
return FullName;
}
One of the fields in my survey is FullName another is LastName. In the xlsForm in the calculation column I added:
pulldata("@javascript","myJSFunctions.js","lastName",${FullName})
My expectation is (was?) that when I added data into the FullName field that the function would add exactly the same value into the LastName field. I realize this is not the correct way to take data from one field in the survey and replicate it in another field. I'm just making sure I understand the basic functionality before I tackle something more complicated.
Once I had that set up, I closed and saved the spreadsheet and published the survey.
When I download the survey to my phone and open it the following text is in the LastName field:
Error: Qt.createQmlObject(): failed to create object:
qrc:/var/mobile/Containers/Data/Application/E1C84E25-205E-4EB7-BCB1-983CFB06576F/Documents/ArcGIS/My Surveys/c0e1879901d442cc8b4bbbddc96c1716/esriinfo/extensions:2:1: Script file:///var/mobile/Con
What am I doing wrong?
Thanks,
Sean