Survey123, somewhere between if then and cascading selects?

1173
12
Jump to solution
10-09-2019 01:23 PM
BRYANHERRON
New Contributor III

I am setting up Survey123 forms for our field guys, one of the questions is the Employee Name, which leads to what their Classification is. Originally I just had 2 text type fields for them to type in the info. Now I am trying to provide them a list to select their name from which I have accomplished with the type select_one Employee or_other on the Survey tab and in the following row a Hidden Type and EmployeeCollated Name and the Employee list in the choices tab.  That works fine, they can select their name and when there is a new employee that hasn't been added to the form yet, they can type in their name.

FYI: I am exporting this all to a word document form of the old paper document they are currently filling out.

Employee A, B & C classifications are Tech-1 Employee D&E are Tech-2 and so on. So what I am trying to accomplish is to populate the "Classification" question based on the input of the Employee name. One thought was to use a series of if then statements. I assume in the relevant column. I don't completely understand how the if/then statements work, but if they do, the concept I envision is:

Row 10 if(${Employee}='other', ${Employee_other}, {go to the next if/then?}) How do you go to the next if/then on false?

Row 11 if(${Employee}='a', ${Tech-1}, {go to the next if/then statement?})

Row 12 if(${Employee}='b', ${Tech-1}, {go to the next if/then statement?})

Row 13 if(${Employee}='c', ${Tech-1}, {go to the next if/then statement?})

Row 14 if(${Employee}='d', ${Tech-2}, {go to the next if/then statement?})

and so on until all the classifications are met. Can you group Employee a,b,c into one if/then?

If the if/then is not the solution then maybe some manipulation of the cascading selects to just populate the classification instead of offering another selection and still allowing user input if ${Employee}='other'?

I'm relatively new to this, any help would be appreciated?

0 Kudos
12 Replies
DougBrowning
MVP Esteemed Contributor

My guess is that EmployeeCollated1 has the name value not the label.  Your csv has the label so there is a mismatch.

When testing it is best to use note instead of hidden so you can see this kinda stuff.   So change to note and see but this is prob it.

Remove the spaces from the employee names in the csv.  You could also add a space to the name part which is kinda ok and kinda not.  (it will work but complains).  There is also a way to get the label instead of the name- see this page https://community.esri.com/groups/survey123/blog/2018/12/02/survey123-tricks-of-the-trade-xlsform-fu... 

0 Kudos
BRYANHERRON
New Contributor III

I'm gonna change my name to Edison, cuz I'm approaching 10,000 ways to make it not work. Brain is mush, I'm done for the day. I'll hit it again in the morning.

0 Kudos
BRYANHERRON
New Contributor III

Solved! This was accomplished via the relevant column.

0 Kudos