Answered

Using variable as minimum number

  • 22 July 2021
  • 6 replies
  • 127 views

Is it possible to use a variable to set the ‘min number’ on a number field? We are looking to vary the minimum on a number field in question 2 based on the answer to question 1. So for example if question 1 answer is Type A, then minumum number on question 2 should be 5, if question 1 answer is Type B, minimum number on question 2 should be 10.

 

I’m aware we can do this with logic/branching but we have almost 50 options in question 1 and question 2 is identical for all 50 options apart from the fact that it requires a different minimum to be set for each.

icon

Best answer by john.desborough 23 July 2021, 00:15

View original

6 replies

Userlevel 7
Badge +5

Hi @danmoore Thanks for stopping by! We don’t have this feature without the fun logic jump setup, but would you mind sharing more about your use case? I’m curious to hear more about what you’re looking to build and share this feedback with our developers, too. 

Sure - we are looking at using TypeForm to accept pledges of airline miles. We accept pledges from dozens of different airlines but for each airline we have a minimum number of miles we can accept in a single pledge.

 

So in question 1 a user would choose an airline (United, Delta, Southwest, etc.) and then based on that choice, we want to set the minimum in question 2 (so our minimum pledge for United might be 10,000 miles while for Delta it’s 15,000 and Southwest it’s 20,000).

 

This workaround of creating a different number question for each airline wouldn’t be so bad if it was just a few airlines but as we accept pledges from dozens of airlines, having to create a separate question for each number just so that we can set a minimum is not ideal. It’s particularly unappealing as we plan to add a photo to the number question page so if we want to change that photo it would require us changing it in dozens of pages.

 

Hope this is clear but happy to provide more detail if needed! Thanks!

Userlevel 7
Badge +6

@danmoore - from another user here.. 

given the number of airlines in the list, how many airlines would have the same minimum number assigned? ie United, KLM, Air Canada all with 10k minimum.. if you can cluster the airlines around the ‘same minimum’ you can reduce the logic jumps and branching.. 

given the current method of assigning logic rules in Typeform, yes, it can get cumbersome - i just did a project recently for a client that had over 4,200 logic rules (don’t ask..the other voices in my head were not happy) - BUT once the logic is done once, then you only have to worry about adding/removing airlines and setting up the minimums .. update is less onerous than initial set-up in these cases. 

i know this is not ideal but setting up the logic to say: if airline is UA or airline is KLM or airline is AC, then go to q2 … then you reduce the number of lines to manage.. (i shudder to think of replicating some of coding we did at EDS for UA back in the day and the tens of thousands of nested sql queries we had to vett)

just a wee thought from the igloo

 

des

Thanks @john.desborough there is indeed some overlap in minimums so it would probably only be a couple dozen logic rules. It’s no biggie I was just wondering if the functionality existed to set minimums from a variable but we will stick with the logic rules as you outlined. Very glad we are only working with a few dozen and not 4200, that makes me feel a lot better :laughing: Appreciate your quick response!

Hello @Liz . I'm facing a similar issue as previously discussed. I've been searching for any updates to Typeform's features that might address this, but haven't found anything yet.;( Could you let me know if there have been any recent developments or new functionalities that might help in setting a minimum number based on a previous question's answer? Thanks for your assistance.

Userlevel 7
Badge +5

Hi @KatGle Thanks for stopping by the community! Lovely to have you here. I’m afraid we don’t have any updated features for variables, so the workarounds above will be the best solutions. 

Reply