Bug in Kobo Collect app

Description

An error occurs due to a difference in how constraints are handled between the Kobo Collect app and the browser-based All Data form.

This error only appears when using the mobile app and not in the browser.

Constraint Code:

this code in father for the first child (options: main person - Spouse - Head of Household - other):

not( . = ‘spouse’ and ( string-length(normalize-space(${spouse_first_name})) = 0 or string-length(normalize-space(${spouse_family_name})) = 0 ) or . = ‘head’ and ( ${head_of_household}=‘none’ or ${head_of_household_alternative}=‘none’ ) and ( string-length(normalize-space(${family_head_first_name})) = 0 or string-length(normalize-space(${family_head_family_name})) = 0 ) or . = ‘head’ and ${head_of_household_alternative}=‘spouse’ and ( string-length(normalize-space(${spouse_first_name})) = 0 or string-length(normalize-space(${spouse_family_name})) = 0 ) )

Steps to Reproduce

  1. when spouse_first_name is empty
  2. choose other in father for the first child
  3. continue entering data in form
  4. press send

Expected behavior

it sends the apply normaly as expected.

the constraint must work and prevent sending if we let father for the first child is spouse while spouse informations is empty.

Actual behavior

it prevents the sending and change the father for the first child to spouse automaticly causing to make constraint to prevent the sending and get stuck

the problem is the app is changing the option in father for the first child to spouse. while in browser there is no problem at all.

Welcome to the community, @oday43! Could you please share your sample XLSForm with the community? This would allow us to test it on our end and determine whether the issue lies with the expression itself. When you provide your sample, kindly remove any unrelated questions and focus only on the ones pertinent to the expression. This will help us review your form more efficiently and provide guidance on whether the issue is with the expression or compatibility between the Collect Android App and Enketo (web form).

1 Like

I cant see anything in this calculation that would differ between KoboCollect and Enketo in terms of execution. But, as @Kal_Lam suggests, can you please post your actual form - preferably stripped down to only the contributing components - so that we might try to reproduce it ourselves.

1 Like

V4 - Copy.xlsx (20.0 KB)
ok thats it

Your form logic is quite complex (and my Arabic is no good!) so it is very hard for me to understand how to fill this in and reproduce what you are seeing.

Could you perhaps reduce the form to only a few questions that will exhibit the behavior, and provide screen shots showing how to fill in the questions correctly to get the different behaviors. Thanks.

kobo form bug report.xlsx (17.9 KB)

use kobo collect

ok enter any information in first 6 question then enter like that::
1


2


3


4

enter anything in other questions the prees send:


kobo collect will change first_child_mother_type “والدة الابن / الابنه الاول“ to الزوجة instead of غير ذلك سادخله في الحقل التالي .
that will triger constraint and it will refuse to send and considered that there is an incorrect entry according to the conditions