Parameters in XLSX not transposed to XML form

I am using Excel to build my forms and have a Parameters column. I limit the size of images using the parameter max-pixels, which works fine…

However, ODK has just released 1.2021.3 which allows the parameter allow-mock-locations=true and this doesn’t work. I have imported the XLSX file to Kobotoolbox and downloaded the xml - it does not have the necessary ‘bind’ instruction:

ODK (online) produces this output:
<bind nodeset="/data/Location" odk:allow-mock-accuracy="true" required="true()" type="geopoint"/>
Kobotoolbox produces this output:
<bind nodeset="/data/Location" required="true()" type="geopoint"/>

I know this is a new feature, but I am surprised that Kobotoolbox strips out parameters that are ODK-Collect specific - and I can’t find a way of adding parameters to the form using the formbuilder…

I have manually edited the xml on my device to add the relevant parameter and find that this works, and the completed form uploads. However, this is not viable as I do not have access to all the devices that will use this form…

Is there a solution or work-around that would allow me to use this function? Or a timescale where support for this will be added.

Many thanks

@seewhy, could you share with us a sample xlsform that has this parameter so that we could also test it at our end?

Hi @Kal_Lam
Here is a sample with just the relevant questions and columns. And the xml that was run through ODK XLSForm Online (so this works as expected).
Many thanks for your help.
Sample-mock.xlsx (9.7 KB)
Sample-mock.xml (1.1 KB)

1 Like

Hello,
why not use ODK Collect instead of KoBoCollect? This has other advantages too.

Thanks for your suggestion - I am using ODK Collect (and have done prior to discovering Kobo’s excellent online tools). My apologies for not clarifying that.

The problem is with Kobotoolbox conversion of an XLSX that removes the parameter value, so it doesn’t work as expected on ODK Collect. I don’t have a way of editing the XML remotely as far as I know.

Kind regards

1 Like

Hi @seewhy, thank you for pointing this out. The feature you are referring to has only just been included into the latest version of pyxform v1.7.0 (seen here in the change log) and KoBo is currently on v1.5.1. You can see the difference in output from the two versions here on your sample form:

--- pyxform-1-5-0.xml
+++ pyxform-1-7-0.xml
@@ -14,7 +14,7 @@
                     </meta>
                 </data>
             </instance>
-            <bind nodeset="/data/Location" type="geopoint"/>
+            <bind nodeset="/data/Location" odk:allow-mock-accuracy="true" type="geopoint"/>
             <bind nodeset="/data/Image" orx:max-pixels="1600" type="binary"/>
             <bind jr:preload="uid" nodeset="/data/meta/instanceID" readonly="true()" type="string"/>
         </model>

I will create an issue for us to upgrade this soon.

Edit: you can track the upgrade here:

1 Like

Hello @Josh,
Thanks!

A lot of users are using ODK Collect together with KoBoToolbox (incl. Enketo preview). So, I think, it would be great if (new) features of ODK would not cause upload or deployment or preview errors in KoBo. (Just a warning might be given instead?)

Users experienced this problem several times in the past, for ex. with hidden type, audit (metadata), start-geopoint, track-changes.
See
https://community.kobotoolbox.org/t/type-hidden-xlsform-not-working-when-trying-to-edit-in-kobotoolbox-formbuilder/6987/9?u=wroos
https://community.kobotoolbox.org/t/support-for-start-geopoint-question/15347
https://community.kobotoolbox.org/t/track-changes-feature/12538

Hi @wroos, this is a separate issue to the original post since one can import, preview, deploy, etc. the Sample-mock.xlsx form without error. Having said that, when ODK releases new features in pyxform we should prioritize upgrading as soon as practical so they are available on our platform. This does not guarantee that Enketo or the KoBo form-builder will support these new features but they will at least be available when one imports an XLSForm containing them to use with Collect.

2 Likes