Select to view content in your preferred language

Javascript functions not working - Copy data to a new survey option in Survey123

303
1
08-01-2022 11:17 AM
AnushaGTI
New Contributor II

Hi,

I created Javascript functions for one of our forms and it works as intended in the original form. However, when we tried to use the copy data to a new form with in the Survey123 desktop app and updating few fields, the script functions are not being triggered as it should.

Is there any workaround to this issue?

Any suggestions are appreciated.

Thanks,

Anusha

Tags (2)
0 Kudos
1 Reply
DougBrowning
MVP Esteemed Contributor

Have you tried the new calculation modes yet?  123 is not seeing anything change so it does not fire the calc.  Forcing it may do it.

https://doc.arcgis.com/en/survey123/desktop/create-surveys/prepopulateanswers.htm 

Calculation mode

The calculationMode parameter entered in the bind::esri:parameters column controls when calculations in questions are calculated, for example, calculationMode=manual. There are four supported values:

  • auto—Calculate when the question is empty or has not been previously modified by the user. If no value is provided, this is the default calculation behavior.
  • manual—The question will only calculate when the Calculate button next to the question is pressed.
  • always—Calculate when any value referenced in the calculation expression changes. This includes dynamic functions, such as now().
  • whenEmpty—Calculate until a nonempty value is returned. Once a nonempty value is returned, the question behaves in the same way as the manual mode. Calculations that contain dynamic functions, such as now(), will not recalculate unless the Calculate button is pressed. The whenEmpty mode is useful when you do not want a question that has already been calculated with a nonempty value to update when the form is reloaded, for example, when opening from the Inbox.
0 Kudos