Select to view content in your preferred language

Pre-populate text field based on previous entry

61
2
yesterday
KatherineScheip
New Contributor

I am having an issue with pulling data from a previous answer to auto populate a text field. Here is my excel: 

KatherineScheip_0-1761327798913.png

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? 

 

0 Kudos
2 Replies
DougBrowning
MVP Esteemed Contributor

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 

0 Kudos
Neal_t_k
Frequent Contributor

https://community.esri.com/t5/arcgis-survey123-blog/use-existing-data-in-your-survey-the-pulldata/ba...

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.

0 Kudos