Hey everyone! I'm relatively new to using Survey123 and XLSForms, so I'm going to ask a question that's been asked a million times before, I'm sure, but I did a lot of looking around and my understanding of how Survey123 & XLSForms is so un-sophisticated that I was just getting lost. Apologies for being repetative here.
Problem statement: I want to do a multiple level lookup so that when I select "Job", "Phase", and "Team member" that my next drop down has the default value for that person's role on that job and phase, BUT if a user wants to change their role, they can, using a drop down.
My effort so far: I created a CSV file that will have all the jobs and all the phases and all the people (right now it's just a sample set for testing), and then created a column that concatenated those and assigned them each roles. Again, right now this is purely dummy data for testing.
In my XLSForm, I have a drop down for job (general_job), a drop down for phase (general_phases), and a drop down for people (labor_level1). Next, I created a text field that displays a concatenation which combines the displayed labels for each of those things, using the jr:choice-name command:
concat(jr:choice-name(${general_job},'${general_job}'),jr:choice-name(${general_phases},'${general_phases}'),jr:choice-name(${labor_level1},'${labor_level1}'))
Everything so-far, so-good.
My next step was to add a calculation to the dropdown question and ideally it should work. One thing to note is that I'm still going on displayed values rather than the name, because in the CSV I don't want to have to include the funny name of the label.
pulldata('rolespulldata','role','concatlookup', jr:choice-name(${labor_concatlookup},'${labor_concatlookup}'))
However, when I put in the pulldata calculation into the role selection question, I'm not getting any response. Nothing. I even tried copying the calculation into a text field to see if there was some conflict between the possible values in the drop down vs the values in the CSV file, but still nada.
I'm attaching the XLSForm and the CSV to see if you guys have any ideas. Thanks again for your help!
Hmmm, I could be wrong about the jr-choice-name thing. At this point, since I'm not able to replicate the issue, you may want to open a support case with Esri Support so they can screenshare with you and better identify the problem.
Good luck! 🙂
Hello @mroberts_troy,
Thank you for passing along the sample XLSForm and CSV! I've tested on my end with Connect 3.13.251 and I am seeing the pulldata() function bring in the correct information:
Just to confirm are you using the same version of Survey123 Connect? You can find the version by selecting the little hamburger on the top right (or your profile icon if you're signed in), and the version will be on the bottom right of the pane that pops up.
If you are using the latest version of Connect back in that menu that popped up when you selected the hamburger if you select Settings > click and hold on the title "Survey123 Connect Settings", this will pop up a Beta tab. In the Beta tab there is a toggle for "Itemset tools" if you enable that back in your survey along the bottom ribbon you will see an Itemsets button. Selecting that Itemsets button, on the bottom right you should see Tables/Views, in that box do you see the name of your CSV (rolespulldata) and if so do you see the CSV data in that table?