Select to view content in your preferred language

Creating month, day, and year for date of birth separately in Survey123 Connect Form

227
4
Jump to solution
12-23-2024 08:53 PM
Almaz_Naizghi
Emerging Contributor

Hello,

I am designing a survey in Survey123 Connect and part of the questions are to collect date of birth as a month, day, and year separately, see print screen below. How can I format these questions?

AlmazNaizghi1_0-1735015230294.png

Thanks!

  

0 Kudos
2 Solutions

Accepted Solutions
ChristopherCounsell
MVP Regular Contributor

I would recommend having a single date question instead of 3 separate questions.

If you must have three, it suggests you have data requirements, which would dictate how you should format the questions. With no clarity on this I would recommend:

  • Day: Integer question, constraint for >0 and < 32
  • Month:
    • Integer question, constraint for >0 and < 13
    • Or a select_one question with a month choice list for each month
  • year, integer question, constraint for >1900

You could also add a list to the year/day questions and try different appearances like autocomplete.

View solution in original post

0 Kudos
TomWingrave
Occasional Contributor

Hello,

Is the requirement to ask the question in this way (i.e. the three separate fields for Month/Day/Year) or is it to return/store the data in this way? If it is the former then Christopher's suggestion below should work great. If it is the latter then you could ask a single date time question and then have 3 hidden fields which pull the elements out into their respective fields using the format-date function.

Year; format-date(${Date_Field},'%Y')

Month; format-date(${Date_Field},'%m')

Day; format-date(${Date_Field},'%d')

Further guidance can be found under the Date formatting section on this web page; https://doc.arcgis.com/en/survey123/desktop/create-surveys/xlsformformulas.htm#:~:text=You%20can%20u...

View solution in original post

0 Kudos
4 Replies
ChristopherCounsell
MVP Regular Contributor

I would recommend having a single date question instead of 3 separate questions.

If you must have three, it suggests you have data requirements, which would dictate how you should format the questions. With no clarity on this I would recommend:

  • Day: Integer question, constraint for >0 and < 32
  • Month:
    • Integer question, constraint for >0 and < 13
    • Or a select_one question with a month choice list for each month
  • year, integer question, constraint for >1900

You could also add a list to the year/day questions and try different appearances like autocomplete.

0 Kudos
Almaz_Naizghi
Emerging Contributor

Thank you for your quick response and recommendation.

I will try to convince the team who are requesting the survey to get a single date entry instead of 3 separate questions.

0 Kudos
TomWingrave
Occasional Contributor

Hello,

Is the requirement to ask the question in this way (i.e. the three separate fields for Month/Day/Year) or is it to return/store the data in this way? If it is the former then Christopher's suggestion below should work great. If it is the latter then you could ask a single date time question and then have 3 hidden fields which pull the elements out into their respective fields using the format-date function.

Year; format-date(${Date_Field},'%Y')

Month; format-date(${Date_Field},'%m')

Day; format-date(${Date_Field},'%d')

Further guidance can be found under the Date formatting section on this web page; https://doc.arcgis.com/en/survey123/desktop/create-surveys/xlsformformulas.htm#:~:text=You%20can%20u...

0 Kudos
Almaz_Naizghi
Emerging Contributor

Thank you for your prompt reply!

To answer your question the request was the former to get three separate fields for month/day/year.

As, Christopher's suggested it is better to get one date entry instead of three separate fields.

0 Kudos