Pull data using the name associated with a value from an external sheet

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:

And this one too …

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

@ak123, :clap: :heart: :partying_face: