Is it possible to pipe text entry answers into a following question based on the date entered? | XM Community
Skip to main content
Solved

Is it possible to pipe text entry answers into a following question based on the date entered?

  • May 13, 2020
  • 5 replies
  • 47 views

First question asks for a list of people's names and dates of joining - both fields are input as text entries with the date in DD/MM/YYYY format.
Can I then pull two entries based on the dates that were entered (I want the most recent two dates) and pipe these into a later question?
Thank you.

Best answer by rondev

On click of next button, read all the person name and their respective joining date as key value pair in js array. Sort based on the value of the js array. On sorted array get the key i.e. person name of first two element of array and store it in Embedded data.

5 replies

rondev
Level 6 ●●●●●●
Forum|alt.badge.img+22
  • Level 6 ●●●●●●
  • 1450 replies
  • May 13, 2020

As date comparison of long list will be little tricky and time consuming using survey flow, it is recommended to use JS to get the name and date of two recently joined people.


  • Author
  • 8 replies
  • May 13, 2020

rondev any advice on how to do that? Sorry I'm not familiar with JS unfortunately..


rondev
Level 6 ●●●●●●
Forum|alt.badge.img+22
  • Level 6 ●●●●●●
  • 1450 replies
  • Answer
  • May 13, 2020

On click of next button, read all the person name and their respective joining date as key value pair in js array. Sort based on the value of the js array. On sorted array get the key i.e. person name of first two element of array and store it in Embedded data.


  • Author
  • 8 replies
  • May 13, 2020

Is there any other way besides using javascript?


  • Author
  • 8 replies
  • May 14, 2020

rondev very helpful, thank you!