Select to view content in your preferred language

Restrict Date Entry Based on Previous Question

4288
10
Jump to solution
11-08-2022 07:58 AM
ZachBodenner
MVP Regular Contributor

Hello,

I am trying to restrict a date range based on a previously entered date. Here's the goal:

Question 1: Enter a date at least seven days from today.

Question 2: Enter a date less than two months (62 days) from the date entered in Q1.

The setup: Survey123 Connect, survey published to Enterprise Portal 10.8.1

Constraints:

Q1: .>date(decimal-date-time(now()) + 7)

Q2: (.>=${Q1}) and (.<=(${Q1} + (1000 * 60 * 60 * 24 * 62)))

 

When published, Q1 works fine, but no date entered into Q2 is accepted by the form (no errors when saving .xls form or publishing).

Happy mapping,
- Zach
0 Kudos
10 Replies
EricaNova
Frequent Contributor

For anyone hitting their head against the wall.. this doesn't always show up in the preview in S123. 

0 Kudos