Pull fucntion with if Condition from multiple Csv uploaded

1. What is the problem? Be very detailed.

we need to download data in same column from two different uploaded csv , based on below

  • selection of type of work ( 1 or 2 )
  • household id
  • city

data need to pull in city field by selecting type of work i.e. 1 or 2
then house hold id need to fill
city field requires if condition : if type of work is 1 then pull data from sheet 1

2. What app or server are you using and on what device and operating system? Include version numbers.


3. What you have you tried to fix the problem?

i tried but could not solve

4. What steps can we take to reproduce the problem?

5. Anything else we should know or have? If you have a test form or screenshots or logs, attach below.

Hi there, have you tried

if(${type_of_work} = '1',
pulldata('sheet1.csv', 'household_id', 'key_match_csv', ${key_match_ODK}),
pulldata('sheet2.csv', 'city', 'key_match_csv', ${key_match_ODK})

Hi ,

Can you please explain


Cheers !


those 2 are variables I made up to illustrate the pulldata() function. You can refer to documentation https://xlsform.org/en/#pre-loading-csv-data

the main take away is that you can use 2 pulldata() functions with different parameters in an if() function