We are trying to get a warning label to display if someone is registering a pregnant client in a family that already contains a pregnant woman. Clients are child cases of family cases. Pregnancy cases are extension cases of clients.
I want all pregnancy_pp cases whose grandparent case_id is the same as the family_id
commcare
Related Topic
- How to reference a child case in a display condition
- When using CommCare Supply, will the WebApps functionality work with supply-point cases
- Display the owner of a case in the case list
- Are there any crucial risks to allowing mobile users sign in with the same username and password to collect data in CommCare
- CommCare – How to Join Multi-Select Lookup Table Values with Commas in a Label
- Can users see all of the same cases when assigned to the same location in CommCare
- How to filter a case list to display only cases that the mobile user’s location owns
Best Answer
The expression is:
To explain:
This part gives the case_ids of the clients in the current family However, it is not structured like a space-separated list. It's structured XML. So we couldn't use
selected()
on that. So we first converted the structured XML to a space separated list withjoin(" ", xxxx)
Then we were able to stick that into theselected(xxx, index/host)
.