Answered

How to add and forward to page according to the result?

  • 22 July 2021
  • 5 replies
  • 37 views

Preciso usar o typeform para fazer a soma de data de nascimento e direcionar o lead para uma página específica de acordo com o resultado. Exemplo: 13/03/1986 = 1+3+0+3+1+9+8+6 = 31 = 3+1 = 4
 

--

 

Google Translation: 

 

I need to use the typeform to sum up the birth date and direct the lead to a specific page according to the result. Example: 03/13/1986 = 1+3+0+3+1+9+8+6 = 31 = 3+1 = 4

icon

Best answer by john.desborough 22 July 2021, 15:38

View original

5 replies

Userlevel 7
Badge +5

Hi @Leilamar Welcome to the community! The language of the community is English, so I hope you don’t mind my translation. 

Since the date field can’t have calculations added to it, this isn’t exactly possible offhand. Though, could you add the birthday field as a short answer like this? 

Then, you’d be able to add a calculation to the short text field, though it would add this as an entire number.  

@john.desborough do you happen to have any fancy math workarounds I’m missing? :joy:

Userlevel 7
Badge +6

@Liz

scratching my head on this one.. there is nothing i can think of in Typeform natively that would do this unless you did this over something as convoluted as the following:

  • q1 - select the day (number) on which you were born from the drop down list - 1→ 31
    • logic rules (ugly bit) - if q1 answer is 1 add 1 to v_day .. etc; if q1 answer is 11 add 2 (1+1) to v_day… 
  • q2 - select month in which you were born from drop down list
    • logic rules similar to above - if q2 answer is jan add 1 to v_month … if q2 answer is dec add 3 (1+2) to v_month 
  • q3 - select the year in which you were born from the drop down list 
    • logic rules get massively ugly here cuz you have to do the ‘addition’ for each year selected ie if q3 is 1980 then add 18 (1+9+9+0) to v_year 
      • i saw ugly because you have the addition for each year you want to show in the list.. 
      • this would really easy for this part if the ability to perform in-form logic rules on matrix questions was available ie 0-9 down the side and four columns across the top for the 4 characters of the year
  • now add up v_day +v_month + v_year into a numeric variable like v_total
    • the value of v_total is going to fall into a range of possible numbers ie 01/01/2000 is likely going to be the smallest number (4) and 29/09/1999 might be the biggest (hey i am just spitballing here @Leilamar) and would result in 48 as the total. 
    • you would then need to have logic rules to decompose each number into the final score along these lines
      • if v_total is 48 then add 12 to score (variable) - if v_total is 31 then add 4 to score. 
    • now you could route users to the appropriate ending page associated with the score
      • if score = 4 jumpto ending 4

 

that’s how i can see doing this inside of typeform using the native logic rules at the moment. it would be a pain to set up all the calculations for all the possible years but it would be done once and then bob’s your uncle. 

ok.. i need another coffee to replenish the brain 

 

Userlevel 7
Badge +5

Wow, I definitely need to drink more coffee, @john.desborough . Thank you!! This is so helpful. 

@Liz

scratching my head on this one.. there is nothing i can think of in Typeform natively that would do this unless you did this over something as convoluted as the following:

  • q1 - select the day (number) on which you were born from the drop down list - 1→ 31
    • logic rules (ugly bit) - if q1 answer is 1 add 1 to v_day .. etc; if q1 answer is 11 add 2 (1+1) to v_day… 
  • q2 - select month in which you were born from drop down list
    • logic rules similar to above - if q2 answer is jan add 1 to v_month … if q2 answer is dec add 3 (1+2) to v_month 
  • q3 - select the year in which you were born from the drop down list 
    • logic rules get massively ugly here cuz you have to do the ‘addition’ for each year selected ie if q3 is 1980 then add 18 (1+9+9+0) to v_year 
      • i saw ugly because you have the addition for each year you want to show in the list.. 
      • this would really easy for this part if the ability to perform in-form logic rules on matrix questions was available ie 0-9 down the side and four columns across the top for the 4 characters of the year
  • now add up v_day +v_month + v_year into a numeric variable like v_total
    • the value of v_total is going to fall into a range of possible numbers ie 01/01/2000 is likely going to be the smallest number (4) and 29/09/1999 might be the biggest (hey i am just spitballing here @Leilamar) and would result in 48 as the total. 
    • you would then need to have logic rules to decompose each number into the final score along these lines
      • if v_total is 48 then add 12 to score (variable) - if v_total is 31 then add 4 to score. 
    • now you could route users to the appropriate ending page associated with the score
      • if score = 4 jumpto ending 4

 

that’s how i can see doing this inside of typeform using the native logic rules at the moment. it would be a pain to set up all the calculations for all the possible years but it would be done once and then bob’s your uncle. 

ok.. i need another coffee to replenish the brain 

 

Meu Deus. Sua resposta foi muito boa mas eu não consegui fazer isso.

Obrigada pela ajuda!

Userlevel 7
Badge +5

Hi @Leilamar

I'm happy you found @john.desborough's answer useful! Can you tell us where exactly did you get stuck? This way we can try to help you! :grin:

Reply