Support new openRosa


it seems that commecareHQ is not supporting the directive “odk-instance-first-load” intoduced in ODK JavaRosa v2.17.0

We are using our own instance of commcareHQ which is maintained by you.

Is it an issue on our instance or commcareHQ doesn’t support it ?

Thanks in advnace

Hi Patrick,

Our version of the JavaRosa engine doesn’t have support for a number of bespoke ODK events / triggers, as we’ve tried to stay a bit closer to the native / spec based XForms implementation. Since our triggers are often used against the longitudinal Case Data persistence layer, we need to be pretty careful about the event DAG to make sure expressions which do expensive database calculations are optimized.

Can you articulate what that event does? Our “default” expressions fire either once on XForms-ready event fires or on repeat create event triggers depending on the context in which the question was created, so there’s a good chance you can recreate its functionality.



According to ODK form the issue with XForms-ready is that it is call every time the form load (it is an issue if one come back to the form later). the odk-instance-first-load does the same but only at the first load.

When I tried to put default value using a previous question I get this error:
"You are referencing a node in this form. This can cause errors in the form " even if it is not blocking it makes the form validation more complex because the question has always a red triangle on le left.

If this error can be discard that could do help.

Best regards

note: I am using XLSform to maintain the form + a script that translate the xml in Commcare format
note2: since XLSForm offline 2.0, the partial compatibility is broken because the constraint message are not recognised anymore and the repeat directive are nested in a group with the same name which create an issue in commcare

Hi Patrick,

This may illustrate a bit of a distinction between the two tools and the execution models.

On our side XForms-Ready is issued the first time the XForm session is loaded. If a form is saved incomplete and later resumed, the event will not re-fire. The event is also propagated to the form in full (as in the Xforms spec) and fired in document order, so as soon as the first question is visible, the event has fired for the whole form.

You can safely use a default value to reference a prior element in the form, but it will only work if the previous quesiton’s value is set at form load, so it also needs to have been configured as a default value. Due to XForms’ declarative model, there is no clean way in our XForms to pre-load a previous question’s user-entered answer in the form into a later question, since we don’t track events for the first time an individual widget is “loaded.” Our XForms are used both a linear fashion as well as a full-page fashion, so that concept doesn’t bubble through cleanly.


1 Like