Is it possible to validate dates in odk-x

For example the birthdate should not precede lets say date of registration or date of registration should not be a future date or date of birth should not be a future date

1 Like

Hi @hissdev! Yes, this is entirely possible using the constraint column in the survey. Starting on line 88 in 1_0_statistical_identification of the attached, we assign the “today” date. Then in line 90 we constrain the date to be today (or earlier) (see constraint column and the messages that are displayed in display.constraint_message.text). You can use a similar syntax for any two sets of dates. quest1_00_0_ELMPS.xlsx (461.7 KB)

1 Like

Many many thanks @elmps2018
I have succeeded partially. The today’s date is displayed but the other date is in another date format, so I can’t move to the next.

Attached are the images

You may need to make these the same format, which should be doable for either of them to change. You can also check the table to see if they are being recorded differently. If you’re still having trouble you can share the excel so we can take a look.