Condition for end limit of Range widget

Hi to all odk community,

I am novice with XLSform /ODK.

1. What is the problem? Be very detailed.

For a project, I'want to adjust the "end" value of the range widget according to a value defined in previous question.

In the "parameters" column, I tried : "start=0;end=${value};step=1"

When I want to convert my form, an error message indicates that the parameters must be a number. The value I call is of type "Integer"

Maybe dynamic value is not support by range widget ?

My goal is to count a number of trees with a max limit depending of the surface.

eg: For a the threshold value of 3 trees per ha, in the case of 2 ha plot, the end value of range widget must be 6.

I used ODK central v1.1.2 and ODK android app

Thanks for you help,

Nicolas

2 Likes

Hi @NicoCen
We're glad you're here. When you get a chance, please introduce yourself on this forum thread.

Yes, this is not supported. What you can do is add constraints to make sure a proper value is selected.

1 Like

Correct, the start, end, and step parameters on the XForm range element are static values, and not dynamically evaluated XPath expressions. However, I could envision having them - especially end - be dynamic could be quite useful in general, as in your example.

Perhaps write up a Feature request as see what sort of traction it gets. :slight_smile:

2 Likes