Select to view content in your preferred language

javascript not working after S123 version 3.18 update

08-28-2023 10:18 AM
New Contributor II

I have tried many ways to trouble shoot this issue with a javascript pulldata function that occurred after our android devices were updated to run version 3.18.145 of survey 123. Everything still works fine on devices running earlier versions (e.g.; 3.17). I used the posts here prepopulate-answers-in-a-repeat-with-last-values to help with my initial trouble shooting, but I am still not getting it to work with the updated devices. 

the pulldata script is used to prepopulate a survey answer with a previous value, in our case the initials of the observer, to be repeated for multiple records. The survey does use nested repeats, the observer field is in outer repeat. 

js =

function previousvalue (repeat, position, fieldname)

{if (position > 1) {return repeat[position-2][fieldname];


and the calculation is once(pulldata("@javascript", "functions.js", "previousvalue", ${s123_sn_habitat}, number(position(${s123_sn_habitat})), "observers"))

where s123_sn_habitat is the name of the repeat and "observers" is the field name.

I have attached the xls form.


0 Kudos
2 Replies
Esri Esteemed Contributor

Hi @AndreaPecharich ,

Could you also share the JS function?  It may be easier to e-mail it (jtedrick AT

0 Kudos
New Contributor II

Sorry for the delay. I emailed the function

0 Kudos