Hello everyone,
I am using S123 Connect (version 3.20.63) to produce a comprehensive park inspection form for my organization. Certain questions will only be necessary on a seasonal basis—for instance, we do not need field crews assessing sledding areas in the summer.
The math behind Survey123's date/time system has been perplexing to me, so I wanted to ask about the feasibility of this workflow:
We have already implemented step 2 as a date question with its default set to today(). Ideally, the solutions to steps 1 & 3 would work regardless of the calendar year.
Has anyone configured a survey to work similarly to this? I would appreciate any insight or experience you could provide. Thank you!
Solved! Go to Solution.
If I was to set this up, I would be pulling the numeric month value out of todays date and into an integer field.
format-date(${todays_date}, '%n')
and then use that to determine if a question is relevant, so if I wanted the question to display only in June, July, and August I would set up my relevant like:
${todays_month} >=6 and ${todays_month} <= 8
If you want more granular control, you can do the same basic set-up with the addition of a zero padded day.
format-date(${todays_date}, '%n%d')
You want to make sure you're using that zero padded day option so that the result will be consistent. That way we can again use a range in the relevant field. This set-up will only be visible June 1 - July 15
${todays_monthday} >= 601 and ${todays_monthday} <= 715
If I was to set this up, I would be pulling the numeric month value out of todays date and into an integer field.
format-date(${todays_date}, '%n')
and then use that to determine if a question is relevant, so if I wanted the question to display only in June, July, and August I would set up my relevant like:
${todays_month} >=6 and ${todays_month} <= 8
If you want more granular control, you can do the same basic set-up with the addition of a zero padded day.
format-date(${todays_date}, '%n%d')
You want to make sure you're using that zero padded day option so that the result will be consistent. That way we can again use a range in the relevant field. This set-up will only be visible June 1 - July 15
${todays_monthday} >= 601 and ${todays_monthday} <= 715
That worked a charm—just what I was looking for. Thank you!
Edit: just wanted to ask if there is a functional difference between using today() as a default versus as a calculation. Are there cases where it's better to use one over the other?
I would put it in the default column if I'm expecting the user to possibly change it, but if it is a date I'm capturing automatically for a calculation or something I'm going to be hiding from the user I put it in calculation. Though that is just personal preference. I use the calculate field a lot more than I do the default one, so it also keeps me from having to do a lot of horizontal scrolling when going through my survey.