I am having an issue with pulling data from a previous answer to auto populate a text field. Here is my excel:
The 'select_one" works as expected.
The text I want to prepopulate based on the previous question does not. No errors are thrown, but no text pops up automatically.
I want to try to avoid if statements.
If I understand correctly pulldata("thecsvfilename", "the name of the field in the csv that corresponds to the above select_one", "the csv field that I want displayed on my text", ${the name of the above question user input})
Is there something wrong with my syntax? Or maybe it had something to do with the field types in my csv?
See the green mark on the field Number. That means its a reserved word and you cannot use it.
Also you can just do ${Fire_Station} in the calc. Pulldata is for grabbing from a service. If the label and name are different you can use jr:choice-name(choice_name, 'question') to get that.
See here for more info https://doc.arcgis.com/en/survey123/desktop/create-surveys/xlsformformulas.htm
The way you have it written answer for ${Fire_Station} has to match the answers exactly in the "NormalStaffing" column of your CSV:
Without more context it is tough. I suspect "NormalStaffing" is the number of staff normally at the station and is that what you want returned? And I would expect ${Fire_Station} be the name of a station? Number != Name, if this is the case you might have your columns switch around in the pulldata calculation. Other wise you may need a help column in your csv to match station to station.?
Also you could try single quotes. Other than that the syntax looks correct, and without seeing your CSV, thats what I would check first.
and then what @DougBrowning said and fix the Number reserve word, it will only cause issues later.