Trying to build a form that will use pulldata() function to verify barcode ID

i’m trying to build a form that will use the pulldata() function to verify barcode ID from a dataset of beneficiary IDs and names. attached is my xls form and the sample database uploaded to my form for kobo collect. The barcode scanner displays the right ID number in kobocollect but the 'search()" function to pull up the beneficiary name and the the pulldata() function to verify the beneficiary ID from the barcode is not working and throws up "no such column: " in attached CSV file… But the columns are there. pls help out ASAP. i’m on the clock to do this. below are snapshots of the xlsform code and csv file.

2 Likes

@Kal_Lam please take a look at this and help out. I need to sort this out urgently.

Hi @henryakuete,

Welcome to the community! Could you share with me your xlsform including the CSV file that you wish to apply the pull data function.

barcode test 2.xlsx (10.8 KB) benDetails.csv (69 Bytes)

@Kal_Lam I look forward to your assistance with this. Its giving me sleepless nights…lol

@stephanealoo can you also please take a look at this and help out?

Hi @henryakuete,

Please see the images below to build a survey form that uses barcode as question type to pull data from the csv file. You could practice this by replacing the barcode (Code) of the csv file with the ones that you have from any of your books (this is the one that i had them with me). Just wanted to show you a demo that if you have a barcode number, you could manage them in your csv file and use the pull data function to get the desired information during your survey.

Image 1 (in the survey tab):

Image 2 (in the csv file):

Note: You will not be able to see the Code Column as shown in the image above in the csv file (the formatting gets distorted in a csv file). Please select the barcode numbers as shown in column A (Code) and then change them to number.

Reference Files:
Barcode & Pull Data.xls (33.5 KB)
Codes.csv (285 Bytes)

Thanks a lot!!!. this works!!! I get the logic now.

1 Like

Addition to this topic
Please add one more thing picture
I want i scan barcode
picture taken from CSV file
Show automatically picture in web browser or andriod application Kobo

Hi
Remember you can customize the whole process using all the available functionalities in one

  1. Barcode as you had been instructed by @Kal_Lam
  2. If the name of the picture is saved in the csv then you can pull this name in a calculate question as an answer e.g. picture1.jpg
  3. You could have response media items that denotes picture1.jpg and then have it pulled from the media file.

You may need to give further illustration of what you intended to achieve since the above example narrows only to inclusion of the picture as a response

Regards
Stephane

1 Like

Hi Kal_Lam,

I simply do not understand the logic in your example.
Why there is no calculate function in your file?
Isn’t this calculate function essential for ODK to pull the right item from the list in CSV?

From lot’s of reading in the here: http://xlsform.org/en/#pre-loading-csv-data I understand, pulldata goes into calculate.

It would be spendid if you could share thoughts or reference asap…

Thanks!

Hi @Lavinia,

Could you please share with us the screenshot of the xlsform where the calculation is missing. It would be easy for me to respond accordingly.

You could look at post 6. It has an example with a calcualtion for the pulldata function. Sorry if i have misunderstood.

Have a great day!

It come from a KoBocommunity member’s post:

here the conversation

1 Like

Hi @Lavinia,

Got you! Kindly please follow the thread of the post that has a marked solution like the one shown in the image below:

Have a great day!

1 Like

@Kal_Lam
Just stumbled upon this thread and its similar to a question I was about to raise. My issue is in my CSV file, I have same barcodes for multiple products. However during data collection, the interviewer needs to select the right product from the list populated after scanning the barcode. Whats the work-around for that?

Thanks

1 Like

@stephanealoo i think he meant displaying the corresponding picture in the app after scanning the barcode. Its something I need help with myself so any assistance will be greatly appreciated.

Regards

Hi @alfidus,

Welcome to the community! Try using the number from a real barcode that you have (and try scanning through the KoBoCollect android app while collecting data) and it should work. The one i used was from a book whose barcode is as follows:

Image 0

Have a great day!

@Kal_Lam, this much I managed to achieve. However there are instances where the same barcode references multiple products. In this instance Id like the app to display all the products related to that barcode and allow the interviewer to select the appropriate products before proceeding.

Thanks

Hi @alfidus,

I don’t think a barcode assigned to a product can be assigned to multiple product as each barcode is unique to the product that it represents.

Have a great day!

Thanks @Kal_Lam. But is there a work-around for popping up the image of the scanned barcode in the APP? Maybe through using the PULLDATA function in the calculated field?

Thanks

Hi @alfidus

You can display all the products related to a barcode by using select one question with search function in the appearance like this:
search(‘csvName’, ‘matches’, ‘columnsToSearch’, ${search_string}).
Where ${search_string} = Barcode value.

Let me know if you need any clarification.

Best,

Yasser

1 Like