Pull data from two cvs values based on previous questions

I have two datasets (two CSV files) and a question that says: Pick which sample you want? The user should choose one database so that the form can provide them with a list of IDs. Basically, i want to switch between 'database1' and 'database2' inside pulldata() based on ${sample} directly. With this caculation, I will be able to match the respondent name with their demographic data that is stored in the CSV file like gender, family size, and ID number.

Instead of trying to switch between 2 different CSV’s inside the pulldata(), try using an if() statement ‘outside’ instead to switch between the two different pulldata functions; eg

if(${db}='1', pulldata('db1', 'name', 'name_key', 'mango'), pulldata('db2', 'name', 'name_key', 'orange'))

1 Like

Thank you so much! It worked although I need to fix another issue since both of the CSV files have the same column names, introducing another challenge. But again, thank you (Y).

YW, glad it works!

FWIW, it shouldn’t really matter what the column names are in your two CSVs, since each pulldata() will specify what field to pull from where. Indeed, I would have expected your two CSVs to perhaps have a similar structure, given their data is obviously being used for a similar purpose… :face_with_raised_eyebrow:

2 Likes