Problem with form display condition

We are students at Boston University School of Public Health taking a
mobile health class. We are currently creating an application on CommCare
that would function as a childhood developmental delays screening tool. Our
application contains one registration module, twelve follow-up modules that
correspond to specific age ranges (containing 72 forms total), and a close
module. We want the specific module and their corresponding forms to show
up based on the child’s age, which is calculated based on the child’s date
of birth. This is the display condition we are using:

(int((today() - date(./childs_date_of_birth)) div 30.4) >= 0) and
(int((today() - date(./childs_date_of_birth)) div 30.4) <= 2)

Our display condition is placed at the form level, and not for individual
questions. However, when we preview our app, we keep getting this error
message:

(int((today() - date(./childs_date_of_birth)) div 30.4) >= 0) and
(int((today() - date(./childs_date_of_birth)) div 30.4) <= 2)

org.commcare.resources.model.UnresolvedResourceException: Invalid XML
Structure(START_TAG (empty) <command id=‘m1-f0’ relevant=’(int((today()

  • date(instance(‘casedb’)/casedb/case[@case_id=instance(‘commcaresession’)/session/data/case_id]/childs_date_of_birth))
    div 30.4) >= 0) and (int((today()
  • date(instance(‘casedb’)/casedb/case[@case_id=instance(‘commcaresession’)/session/data/case_id]/childs_date_of_birth))
    div 30.4) <= 2)’>@3448:347 in java.io.InputStreamReader@75b4be1f): Bad
    XPath Expression {(int((today()
  • date(instance(‘casedb’)/casedb/case[@case_id=instance(‘commcaresession’)/session/data/case_id]/childs_date_of_birth))
    div 30.4) >= 0) and (int((today()
  • date(instance(‘casedb’)/casedb/case[@case_id=instance(‘commcaresession’)/session/data/case_id]/childs_date_of_birth))
    div 30.4) <= 2)}

The Error message appears immediately after clicking on “Start” in the App
Preview. Please let us know how we might be able to fix the display
condition.

Hello,

That expression looks OK to me. Could you confirm that you were using the
most up-to-date version on Live Preview by clicking the button here
https://confluence.dimagi.com/download/attachments/10224029/app_preview_sync.JPG?version=1&modificationDate=1490029958465&api=v2
?

If you were and the error persists, please report a bug and we can take a
closer look.

Thanks,
Will

··· On Thu, Apr 20, 2017 at 3:07 AM, wrote:

(int((today() - date(./childs_date_of_birth)) div 30.4) >= 0) and
(int((today() - date(./childs_date_of_birth)) div 30.4) <= 2)

Hello,

Thank you for the quick reply. I believe we are using the most up-to-date
version on Live Preview (it does not have the login option but everything
else is the same). Would that mean that we should report a bug?

Thank you,
Nehemiah

··· On Thursday, April 20, 2017 at 1:57:15 AM UTC-4, William Pride wrote: > > Hello, > > That expression looks OK to me. Could you confirm that you were using the > most up-to-date version on Live Preview by clicking the button here > > ? > > If you were and the error persists, please report a bug and we can take a > closer look. > > Thanks, > Will > > On Thu, Apr 20, 2017 at 3:07 AM, <nsk...@bu.edu > wrote: > >> >> (int((today() - date(./childs_date_of_birth)) div 30.4) >= 0) and >> (int((today() - date(./childs_date_of_birth)) div 30.4) <= 2) >> > > >

Yes, please do.

Cheers,
Will

··· On Thu, Apr 20, 2017 at 4:28 PM, wrote:

On Thursday, April 20, 2017 at 10:14:39 AM UTC-4, nsk...@bu.edu wrote:

Hello,

Thank you for the quick reply. I believe we are using the most up-to-date
version on Live Preview (it does not have the login option but everything
else is the same). Would that mean that we should report a bug?

Thank you,
Nehemiah

On Thursday, April 20, 2017 at 1:57:15 AM UTC-4, William Pride wrote:

Hello,

That expression looks OK to me. Could you confirm that you were using
the most up-to-date version on Live Preview by clicking the button here
https://confluence.dimagi.com/download/attachments/10224029/app_preview_sync.JPG?version=1&modificationDate=1490029958465&api=v2
?

If you were and the error persists, please report a bug and we can take
a closer look.

Thanks,
Will

On Thu, Apr 20, 2017 at 3:07 AM, nsk...@bu.edu wrote:

(int((today() - date(./childs_date_of_birth)) div 30.4) >= 0) and
(int((today() - date(./childs_date_of_birth)) div 30.4) <= 2)


You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.