Possible to direct participants to a question block based on date of birth given? | XM Community
Skip to main content
Solved

Possible to direct participants to a question block based on date of birth given?

  • September 13, 2021
  • 5 replies
  • 213 views

Hello,
I was wondering is it is possible to do something like this in qualtrics.
We require parents to answer a specific question block based on their child's age in month and days. Right now we have four multiple choices for parents to select from, which would direct them to the correct block.
However, this leaves room for error, and so was wondering if it would be possible for parents to give their child's date of birth, and this to automatically calculate child age in months & days, which would then send them to the correct block?
Many thanks for your help!

Best answer by JeremyK

Agreed, that leaves the door open for parents to miscalculate, throwing off your data. What about this:
Textbox question asking for child's DOB, with validation on textbox for DOB. Add JavaScript that does the calculation (something like this) and sets the age of the child to an embedded Data field. You can then drive your branch logic off that embedded data field's value.

5 replies

JeremyK
Level 3 ●●●
Forum|alt.badge.img+7
  • Level 3 ●●●
  • September 14, 2021

Have you checked out Branching Logic in the Survey Flow? You could have x number of branches with conditionals for what the parents select in your multiple choice question that would take your respondents to different blocks, no math required.


  • Author
  • September 15, 2021

Hi Jeremy,
Thank you for your quick reply! Right now we are using branching logic so that parents choose a specific category (child age in months & days).
However, we foresee this might cause issues if a parent incorrectly calculates their child's age, and so were wondering if it was possible within Qualtrics to ask parents their child's DOB, which could then be used to calculate age in months & days automatically, and direct them to the correct questionnaire?
Thanks


JeremyK
Level 3 ●●●
Forum|alt.badge.img+7
  • Level 3 ●●●
  • Answer
  • September 15, 2021

Agreed, that leaves the door open for parents to miscalculate, throwing off your data. What about this:
Textbox question asking for child's DOB, with validation on textbox for DOB. Add JavaScript that does the calculation (something like this) and sets the age of the child to an embedded Data field. You can then drive your branch logic off that embedded data field's value.


  • Author
  • September 16, 2021

Ah thank you that looks like a really good solution - I will try that out today 😊


Forum|alt.badge.img+1
  • April 9, 2022

Hi! TSharp I'm also trying to do something similar for my project, but I am new to using Javascript and embedded data in Qualtrics. If you don't mind, can you share screenshots of what worked for you (survey flow, javascript)? I was able to follow JeremyK's suggestion up to the part about adding JavaScript, but I am kind of lost thereafter. Thanks in advance!