How to limit the display of years to certain ranges


I have a question asking the year the business started and able to set up year under appearance. The default year range being displayed spans from 2019-2030 (attached image), we rather wanted to make the default list of past year ranges like from 2010-2020 or 20 year list ranges from 2001-2020.

Your help on this is much appreciated.


Welcome to the community, @mjemal! Maybe you could design your xlsform as outlined below, which should restrict users to select the date from within a specified range:

In the survey tab of your xlsform:

Data entry as seen in Enketo: (when a date is entered outside the range)

Data entry as seen in Enketo: (when a date is entered within the range)

Image 3

Reference xlsform:

Date Constraints.xls (37.5 KB)

I think the idea was to filter the date widget values BEFORE the data entry. This would be a great improvement for Enketo/Collect, not only for years. Appearance or parameters could be used for this enhancement.

Esp. if the number of valid years is low, a current workaround might be to use select_one MyYears as type. (But you loose the date feature and the value is stored as “year” instad of “yyyy-01-01”).

I think the constraint option of Kal_Lam together with a hint text (and enumerator training), is a good solution.
Kind regards


@Kal_Lam Thank you for your response on this. The suggested constraint evaluates the data entry values very well but doesn’t seem enforce to the display.

@wroos that is exactly what I’m looking for. If this is something easy to do- your further instruction how to handle within appearance/parameter would be much appreciated.

I am sorry, this was just an idea how to enhance a future release. You cannot do it so far.

1 Like

That is absolutely fine. Great to know that and hopefully this functionality is in play soon.
Thank you!!

1 Like