Validation syntax

Hello

I want to validate a data entry field in the following situation. A previous question (Total_individual_Beneficiaries) indicates the total number of beneficiaries and in one question (integer) I want to know how many thereof are women (Number_Women). Thus, valid values would be between 0 and up to the total individual beneficiaries.
My following syntax ist not saved properly in the webinterface and thus only checks for negative values:
(. >= 0 and . < ${Total_individual_Beneficiaries})

Does it have anything to do with the group? Or, is the syntax just wrong?

Thanks and best regards
Marc

Hi Marc,

What you’re writing sounds correct. What exactly do you mean with the syntax is “not saved properly in the webinterface”? I can only see a slight mistake in your formula: The second part should be less than or equal to (since all beneficiaries can be women). Here is what I did to reproduce your question:

Inline image 1

See the attachment to reproduce it.

Best,

Tino

Validation_check.xls (5.5 KB)

···

On Mon, Aug 3, 2015 at 9:42 AM, Marc Zoss marc...@gmail.com wrote:

Hello

I want to validate a data entry field in the following situation. A previous question (Total_individual_Beneficiaries) indicates the total number of beneficiaries and in one question (integer) I want to know how many thereof are women (Number_Women). Thus, valid values would be between 0 and up to the total individual beneficiaries.
My following syntax ist not saved properly in the webinterface and thus only checks for negative values:
(. >= 0 and . < ${Total_individual_Beneficiaries})

Does it have anything to do with the group? Or, is the syntax just wrong?

Thanks and best regards
Marc

You received this message because you are subscribed to the Google Groups “Kobo Users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to kobo-users+...@googlegroups.com.

To post to this group, send email to kobo-...@googlegroups.com.

Visit this group at http://groups.google.com/group/kobo-users.

For more options, visit https://groups.google.com/d/optout.

Dear Tino

thanks for your quick and clear feedback - greatly appreciated. I have done just as you have indicated (see screenshot attached) and then pressed “save and exit” which is duly accepted and no error is thrown. However, when reentering into the form it does not seem to have saved it properly (see attached screenshot “output”). When looking at the x-form, only the above zero part is saved (. >= 0).

I also put the constraint in the x-form and imported it but the behaviour is the same as above. Might this be a bug?

Thanks for your feedback and best regards
Marc

···

On 3 August 2015 at 22:18, Tino Kreutzer tino.k...@kobotoolbox.org wrote:

Hi Marc,

What you’re writing sounds correct. What exactly do you mean with the syntax is “not saved properly in the webinterface”? I can only see a slight mistake in your formula: The second part should be less than or equal to (since all beneficiaries can be women). Here is what I did to reproduce your question:

See the attachment to reproduce it.

Best,

Tino

You received this message because you are subscribed to a topic in the Google Groups “Kobo Users” group.

To unsubscribe from this topic, visit https://groups.google.com/d/topic/kobo-users/QAd6botvddo/unsubscribe.

To unsubscribe from this group and all its topics, send an email to kobo-users+...@googlegroups.com.

To post to this group, send email to kobo-...@googlegroups.com.

Visit this group at http://groups.google.com/group/kobo-users.

For more options, visit https://groups.google.com/d/optout.

On Mon, Aug 3, 2015 at 9:42 AM, Marc Zoss marc...@gmail.com wrote:

Hello

I want to validate a data entry field in the following situation. A previous question (Total_individual_Beneficiaries) indicates the total number of beneficiaries and in one question (integer) I want to know how many thereof are women (Number_Women). Thus, valid values would be between 0 and up to the total individual beneficiaries.
My following syntax ist not saved properly in the webinterface and thus only checks for negative values:
(. >= 0 and . < ${Total_individual_Beneficiaries})

Does it have anything to do with the group? Or, is the syntax just wrong?

Thanks and best regards
Marc

You received this message because you are subscribed to the Google Groups “Kobo Users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to kobo-users+...@googlegroups.com.

To post to this group, send email to kobo-...@googlegroups.com.

Visit this group at http://groups.google.com/group/kobo-users.

For more options, visit https://groups.google.com/d/optout.


Marc Zoss
Unter-Grunhof 20
CH-6032 Emmen
Switzerland
+41 76 505 64 53

Hi Marc,

You’re right - after reopening the form there is a bug with reading the ${variable} inside the manually set validation criterion. We’ll fix it and deploy it to the servers ASAP.

Thanks for pointing this out.

Best,

Tino

···

On 3 August 2015 at 22:18, Tino Kreutzer tino.k...@kobotoolbox.org wrote:

Hi Marc,

What you’re writing sounds correct. What exactly do you mean with the syntax is “not saved properly in the webinterface”? I can only see a slight mistake in your formula: The second part should be less than or equal to (since all beneficiaries can be women). Here is what I did to reproduce your question:

See the attachment to reproduce it.

Best,

Tino

On Mon, Aug 3, 2015 at 9:42 AM, Marc Zoss marc...@gmail.com wrote:

Hello

I want to validate a data entry field in the following situation. A previous question (Total_individual_Beneficiaries) indicates the total number of beneficiaries and in one question (integer) I want to know how many thereof are women (Number_Women). Thus, valid values would be between 0 and up to the total individual beneficiaries.
My following syntax ist not saved properly in the webinterface and thus only checks for negative values:
(. >= 0 and . < ${Total_individual_Beneficiaries})

Does it have anything to do with the group? Or, is the syntax just wrong?

Thanks and best regards
Marc

You received this message because you are subscribed to the Google Groups “Kobo Users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to kobo-users+...@googlegroups.com.

To post to this group, send email to kobo-...@googlegroups.com.

Visit this group at http://groups.google.com/group/kobo-users.

For more options, visit https://groups.google.com/d/optout.

You received this message because you are subscribed to a topic in the Google Groups “Kobo Users” group.

To unsubscribe from this topic, visit https://groups.google.com/d/topic/kobo-users/QAd6botvddo/unsubscribe.

To unsubscribe from this group and all its topics, send an email to kobo-users+...@googlegroups.com.

To post to this group, send email to kobo-...@googlegroups.com.

Visit this group at http://groups.google.com/group/kobo-users.

For more options, visit https://groups.google.com/d/optout.

Marc Zoss
Unter-Grunhof 20
CH-6032 Emmen
Switzerland
+41 76 505 64 53