XLS form 'relevant' logic that references a group not being processed (Pyxform >= 4.0.0)

1. What is the issue? Please be detailed.

I have an XLS form that i created a while ago and i publish the form through onadata where it produces the XML. I have been using python2 all this time with pyxform 1.5.1

I have now migrated to python3 and pyxform 4.0.0. The XML produced is slightly different and i have no issues with the slight change in structure. My issue is that under relevant (on a group), the engine does not seem to process that logic, it just simply isn't there in the final XML. There is no binding on that node to anything at all.

**2. What steps can we take to reproduce this issue?

Create an XLS form with a group and add relevant logic to process a previous field.
I am doing** selected(${surf_type} , 'FLEX') or ${surf_type} = 'FLEX'
After publising the form there is no node bound to these.
The form just runs through all the groups without checking what surf_type is

**3. What have you tried to fix the issue?
Tried changing the format of the relevant logic.
Tried using latest pyxform version (**4.4.1)

4. Upload any forms or screenshots you can s

hare publicly below.

Please see the attached.

If you can, please post the entire form so the community can help.

If the form can't be shared publicly, send it to me in message (but note that it may take longer to get a answer)

Unfortunately i can not share the form publicly.

How do i send you a message?

I do not see any compose button.

Please reply to the message I've sent you with your form. You can also email it to support@getodk.org.

I tried the most minimal form given the information you provided: grp_relevant.xlsx (8.8 KB)

This converts as expected using https://getodk.org/xlsform/ which runs the latest code merged to https://github.com/xlsform/pyxform Can you reproduce the issue with your full form on that site? If you can, I agree that sending it as @yanokwa described would be a good next step.

As a side note, the ${surf_type} = 'FLEX' is not needed: the selected condition will always be true if the equality condition is!

I tested the form you sent me on getodk.org/xlsform, which is currently running pyxform v4.4.1, and it works as expected. The generated XForm correctly shows different sets of questions in Enketo based on the value of surf_type.

Based on that result, the issue appears to be somewhere in the pipeline you’re using to process the form.

Hi Yanokwa

Agreed, the problem should be in my code since https://getodk.org/xlsform/ produces the right xml.
I am using some code to fix the issue, which runs after the XML is produced.

This is just a work around until i have time to debug the pipeline.
I appreciate the time you have taken to look at the issue :folded_hands: .

Kind Regards

Dalitso Bender

Hi LN

Yanokwa managed to assist and it's pointing to my code.

Thank you

Regards

Dalitso Bender