What would the xlsform line look like to display the message "invalid survey" and exit the survey if the user tries to collect data on any date other than 2/5/2024. I know this should be simple but I can't get it to work. In other words, I want the relevant column to evaluate today's date and if it's a date other than 2/5/24, the "invalid survey" will be displayed.
This is the note (message) I want to display when the user presses collect to open the survey and the date is anything aside from 2/5/2024. I thought that I just need a constraint in the "relevant" column for the survey to know whether to be displayed or not. Just looking for what to put into the relevant column and/or additional lines prior to this line if additional logic is needed.
type name label
note | surveyerror | <font color="red"><b>This survey can only be used to open drop boxes on Monday, February 5</b> </font> |
Thanks, This is the message I want to display if the user tries to use the survey on any date other than 2/5/2024. I thought that I just need a constraint in the "relevant" column for the survey to know whether to be displayed or not. Just looking for what to put into the relevant column and/or additional lines prior to this line if additional logic is needed. I can figure out how to show or hide the rest of the questions based on relevant column.
type name label
note | surveyerror | <font color="red"><b>This survey can only be used to open drop boxes on Monday, February 5</b> </font> |
The calculation I have in my original post would do that. Just make your relevant column this: ${date_restriction}=1
You can't just end a survey, but you can make all of the content relative. If a condition isn't met, the content wont show. It's up to the user to close/end the survey.
This restricts surveys to before Jan 5th:
You can convert the time to a custom date format if you'd like by using format-date(). Here is the blog.
You will notice that the time is in a super unfriendly UNIX format. That is S123's default. If you want to know what a specific date is in UNIX, you can get that quickly with this (below). Just select a date, and it will show you the UNIX date.