I have a select_one question asking for County. Based on that selection, I want to calculate/assign a Region. I want that Region to be auto-populated based on the County selection.
what I currently have in the calculation cell: pulldata("@choice",'region','name',${jurisdiction})
Survey design and results:
See what I am doing wrong?
Solved! Go to Solution.
You’re very close. The issue is that your pulldata() syntax is incorrect for XLSForm. In pulldata(), the second argument must be the column you want returned, not "@choice".
Use:
pulldata('file','column_to_return in the csv','lookup_column in the csv','lookup_value')
So in your case:
file → region (the name of the CSV file without .csv)
column_to_return → region
lookup_column → name
lookup_value → ${jurisdiction}
Meaning: Look in the region.csv file, find the row where name = selected jurisdiction, and return the region value.
You’re very close. The issue is that your pulldata() syntax is incorrect for XLSForm. In pulldata(), the second argument must be the column you want returned, not "@choice".
Use:
pulldata('file','column_to_return in the csv','lookup_column in the csv','lookup_value')
So in your case:
file → region (the name of the CSV file without .csv)
column_to_return → region
lookup_column → name
lookup_value → ${jurisdiction}
Meaning: Look in the region.csv file, find the row where name = selected jurisdiction, and return the region value.
@hmorgan thanks for the reply! That worked!