ak123
August 11, 2022, 7:59am
1
I have a form for collecting GPS points of communities as well as some information on population. I have a list of 50,000 communities in an external sheet in a cascade format (using district codes). Each community has a unique ID for its name and the community name for the label.
I also have old information on the population of these communities that I want to display as a note when an enumerator selects a community.
I thought about using “pullData” as part of a calculation to create a note showing the population of the community, however I’m not sure how to create a pullData calculation that will use the the community name (the unique ID) and not the community label (a non-unique name).
The external sheet looks like this:
list name
name
label
districtCode
settlements
abc_0001
Ab Dara
district_0001
settlements
abc_0002
Ab Mosa
district_0001
My pull data .csv looks like this:
name
communityName
label
abc_0001
Ab Dara
Population: 1000
abc_0002
Ab Mosa
Population: 500
Any advice would be appreciated!
Welcome to the community, @ak123 ! Maybe these posts discussed previously should be able to help you solve your issue:
@fjiva , maybe this workaround should solve your issue:
In the survey tab of your XLSForm:
[Image 1]
The CSV file:
[Image 2]
Data entry screen as seen in Enketo: when nothing is entered
[Image 3]
Data entry screen as seen in Enketo: when a book code within a range is entered
[Image 4]
Data entry screen as seen in Enketo: when a book code out of the range is entered
[Image 5]
Reference XLSForm:
Pull Data (Skip).xls (28.5 KB)
Reference CSV file:
Codes.csv (137 Bytes)
Note:
If…
And this one too …
Hi @stephanealoo
Thanks for updating
However i could able to the same ,
just sharing in case any one from community need it
if(${work} = ‘1’,pulldata(‘recoveryupload.csv’, ‘branch’, ‘memecode_key’, ${ecode}),pulldata(‘odupload.csv’, ‘branch’, ‘memecode_key’, ${ecode_x}))
Above formula was used to pull data from two different external file basis pull method
Please check and guide in case i missed something ,if any
type
name
label
required
relevant
appearance
calculation
read_only
s…
ak123
August 13, 2022, 9:17am
3
Dear Kal_Lam, thanks for taking the time to respond. After going through the examples and playing around I have a solution:
external sheet
list name
name
label
districtCode
settlements
abc_0001
Ab Dara
district_0001
settlements
abc_0002
Ab Mosa
district_0001
pullData.csv
unique_ID
communityName
pop
abc_0001
Ab Dara
Population: 1000
abc_0002
Ab Mosa
Population: 500
The solution
select_one_from_file communities_24042022.csv
settlements
Select the community name from the list
If the name is not there, please leave blank and add the community name on the next question
ADM2Code=${ADM2Code}
calculate
settlement_code
string(${settlements})
calculate
pop
pulldata(‘pullData’,‘pop’,‘unique_ID’,${settlement_code})
TRUE
note
pop_note
Population (November/December 2021): ${pop}
TRUE
Thanks again!
2 Likes