Embedded data based on response to two questions and age calculation | XM Community
Solved

Embedded data based on response to two questions and age calculation


Userlevel 2
Badge +1

Hi,
I want to add an embedded data based on age and response to two different questions.
Something is lines of if(age > 45 && age < 50) and the response to questions 3 and 4 is no, I want this an embedded data = ineligible.
My age calculation is working and I have age as an embedded data.
Thank you,
Simin

icon

Best answer by CarolK 16 June 2022, 15:15

View original

4 replies

Userlevel 7
Badge +37

Is there a reason you need to be able to do this as custom code? We would do this via the Survey Flow, using branch logic that combines the different variables and then a nested Embedded Data step to set the appropriate value (whether that's "Eligible" = No or "Ineligible" = Yes or "Qualified = "Ineligible")

Userlevel 2
Badge +1

Hi,
I have that in place but need the embedded data I asked for on top of it.

Userlevel 7
Badge +37

I'm sorry, I'm confused. You have an Embedded data field at the start of your survey flow for Age (type = Numeric, because you want to select based on ranges later) and then further down (after the pertinent questions) you also want to have a branch in the Survey flow that uses a combination of Age (is between X and Y) AND survey questions (Q3=No) AND (Q4=No) to set another Embedded data field that indicates Eligibility... Just as a good practice I would set "Ineligible" and then use another branch to set anyone who is not Ineligible to Eligible so that the data is all there and clean.
You didn't mention any other fields needed, but that would give you Age and Eligibility for each respondent. What else was needed?

Userlevel 2
Badge +1


Thanks CarolK , just understood what you meant :)

Leave a Reply