Multi-condition in Pull data

As we know, with Pull data functionality we can bring in other column data of the csv when one of the field value matches with the fed in data of live form.
But can we use it for checking values of 2 fields together against the csv?

Like, for patient revisit form, there are same patient names with different village names. I am trying to pull in data of a patient using patient name. But it only pulls the topmost line data of the csv. Because of this, the patient of only one village is displayed all times, irrespective of patient name exists with other village names too.
As seen in below screenshot, The patient from village ‘Talabfali’ is Male, but the pull data brings in that of Pagarfali village.

How to pull data comparing 2 values? Is it possible? kindly help!

xlsx form:
PatientRevisitKobo.xlsx (9.6 KB)

Media file of Patients
PatientVisit.csv (226 Bytes)

@meerakhanna, yes, you got that correct. The pull data function will only pull the first match value and not go to the next search. The best approach to pulling data would be using a unique ID instead of the name match. This is because a name could have a subsequent match, but the unique ID would not have.

Is there any possibilty to combine two existing variables to get a (unique) pulldata case, please?

Might another function working on external data be an option, e.g. select_from_file, search, etc.

@Kal_Lam Right, I have used unique key too. But in this scenario, I cant use the unique id, because, I have to capture the matching values using the Patient name entered in the field and there could be more than 1 unique value.
Here in kobo, there isn’t any string function which can enable me to try for other alternative.

That’s why i thought I may get some solution for such scenario.
And I am sorry that your reply can’t be the solution for the need here.


Thank you dear @marea_ambulance !! This logic certainly will work.

1 Like