Select to view content in your preferred language

One to Many select one lists based on input from previous list

1930
3
01-03-2017 02:18 PM
RhettZufelt
MVP Notable Contributor

Is it possible to have multiple select_one lists based on the input from another select_one list:

I want to have the number of employee drop downs to represent the number picked in Number of Employees (see attached image=desired outcome):

I know I can do this with a repeat, but I don't want related tables.  I would like each Employee # to be it's own field.

R_

Thought I posted a question, but I see it is a discussion instead.  Sorry.

0 Kudos
3 Replies
MitchellProctor
Deactivated User

Hi Rhett,

There's actually a way to do this that should work pretty well, provided the name value of each individual answer to your initial select_one is a number. Entering this:

${employeeNo} >= 3

into the relevant column for the Employee 3 field would prevent it appearing unless your answer for the 'Number of Employees' question was 3 or more. Simply replicate this accordingly across all of the questions you want to make conditional and it should work how you want it to.

RhettZufelt
MVP Notable Contributor

Thanks for the reply Mitchell,  however, it does not seem to be working as one would expect.

I think it is an issue with the select_one being text rather than a number.  My choices are numbers, so figured it should work, but does not recognize them as such.

If I change my select_one to integer, then it works as expected, but, I don't want to have to enter a number here, and want to pick it from a drop down list (would make the only field in the form that can't be selected, want to avoid text/num entry all together).

documentation suggests that this should work to cast the number to an integer, but it doesn't:

int(${employeeNo}) >= 3

Will not display any of the "relevant" fields.

So, does anyone know a "trick" that will make a number choice from select_one "behave" as a number?

Do I just have some syntax issue that I'm not seeing?

R_

0 Kudos
RhettZufelt
MVP Notable Contributor

turns out that it works as string if set up properly.

This seems to work:

${employeeNo}>='choice0'

${employeeNo}>='choice1'

0 Kudos