Unable to filter casedb based on user property

9 views
Skip to first unread message

Chaiwa Berian

unread,
Oct 2, 2017, 4:24:01 PM10/2/17
to commcare-users
Dear CommCare Users,

Why would this piece of code fail to work?:
You currently have <output value="count(instance('casedb')/casedb/case[@case_type = 'care_group'][health_facility = <output value="#user/health_facility" />])" /> Care Groups. Are you sure you want to add another one?

Every time I try to save, I get this error:


Any help?
Thanks and kind regards,
Chaiwa.


William Pride

unread,
Oct 2, 2017, 5:00:09 PM10/2/17
to commcare-users
Chaiwa,

When you're writing an XPath expression you no longer use the <output value=''> syntax - you can reference the value directly. So, try (pseudocode):

<output value="count(instance('casedb')/casedb/case[@case_type = 'care_group'][health_facility = '#user/health_facility'])" />

Cheers,
Will

--
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.

chaiwa.berian

unread,
Oct 2, 2017, 5:08:11 PM10/2/17
to William Pride, commcare-users
Thank you William, that helped! :)



Sent from my Samsung Galaxy smartphone.
You received this message because you are subscribed to a topic in the Google Groups "commcare-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/commcare-users/AqRCUFtiaw8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to commcare-user...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages