0

Hi I am configuring an odk collect form for collecting household information, so i wanted to put a relevant attribute to check if any of the members entered per household has been allocated a relationship_id of 1 if not to display an error message and prevent the form from proceeding to the next group and also to make sure that if a member has been assigned a relationship_id of 1 to ensure that not more than one member is assigned this relationship_id of 1 (for household head)and the rest of the members can have other relationship_ids.

I used the XPath Expression on the next group but it is only hiding that group and continuing with the rest of the form to the group after the one that's been hidden. Here is the expression: count(/data/members_info_begin/member_info_repeat_begin/member_general_info_begin[relationship_id='1' ]) = 1

But i wanted an XPath Expression that checks if among the the members entered non has been allocated a relationship_id of 1 then to display an error and prevent the form from proceeding until atleast on e member has been assigned a relationship_id of 1 and also to check if among the members collected there are more than one members with a relationship_id of 1 if yes then to display an error message and also prevent the from from proceeding until only exactly one member has been assigned a relationship_id of 1.

0 Answers0