Limited comparison operators under validation criteria

When i import an XLS form with (<=) or try to edit it in kobotoolbox, only (= or != ) operators are available in the drop down under validation criteria area and there isn’t an option of adding one that is missing. How can i enter/use other comparison operators under validation criteria area in kobotoolbox?

image

Hi @nhellen,

Welcome to the community! For details on using the operators and functions, kindly please visit the odk site here.

Thanks for feed back @Kal_Lam. I have viewed the document and i seem to have the operators right but the issue is that only = and =! are available in the kobotoolbox form builder. And even if you use < or >= etc when designing in xls, it turns in to = when you view it in kobotoolbox after uploading it.

But as far as I experienced Kobotoolbox will apply the operators as you encoded them in XLS. after uploading. Just don’t check in the formbuilder.

1 Like

FYI There’s a number of things that you can do in XLSForm that are not supported/exposed in Kobo’s KPI formbuilder, but (thankfully) so long as you dont try to edit the associated item in KPI they’ll get re-exported untouched if you re-save your form.

That said, IMO this looks like its worth logging as a bug: KPI shouldn’t display invalid data. If it doesn’t recognize the constraint’s XPath expression - because it cant parse relational operators <, >=, etc - then it minimally it should display nothing (or preferably some indication its a “custom expresion”).

1 Like

Hi @nhellen, @bd_burundi

KoBoToolbox at the moment supports much more operations in the form builder UI then it usually would do:

Users are now able to add constraints either through Add a condition or manually through Manually enter your validation logic in XLSForm code as outlined in the image below:

Besides, you should have a bunch of operations (like =, !=, >, <, >= and <=) that should now support under the Add a condition

You could also add multiple criteria as shown in the image below:

As follows:

1 Like