Pulldata function

Hi!

I have a question about the pulldata function.
I have done all the exercises from http://xlsform.org/en/ but cant get the pulldata function to work.
All that the ODK Collect says when I upload the form is "The fruit is pulled from csv."
What am I doing wrong?
I would really appreciate all help, thanks!
The form looks like this:

I have done everything as in the exercise but it still wont work.

-Matti

1 Like

Hi Matti,
Here is a sample from my calculation column and this works for me.
csv file name: verification
HHH Name: name to display from the csv file
Code: Code is also a column on the csv file
barcode_test: this is a field on ODK.

pulldata('verification','HHH Name','Code',${barcode_test})

Can you send me your xlsform and the csv named 'fruit'. I can get this to work for you and resend back.

Joseph

Thanks for your reply. I got it working now.
Seems that the csv files info has to be separated with commas and not with semicolons as Excel saves it as.
Just replaced the semicolons with commas and it started working.
But now I have an other question.
How can I edit the information that I brought from the csv file in Collect?
Or is it even possible?
In the csv file I have just one thing that I would have to edit. For example, I have this written in the file "/3" and I would have to just put a number in front of the slash like this for example "2/3".
Is it possible to do this with collect?

-Matti

1 Like

SECTION F.pdf (185.2 KB)
Please someone should assist me with how to do this question in xlm format

@Baba, from the pdf, it seems the questions are single select not multiple. Is this correct?

It is single select, although I have found a way round to solve the problem. Thanks

Hi Joseph, what is "${barcode_test}? is it the name of the calculation field or is it another field?

I got this error:
FormLogicError: pulldata with incorrect number of parameters found: pulldata('localidades', 'localidad', 'IDPC_key')

localidades is my csv file
localidad is the data I want to include in the form
IDPC_key is the unique identifier.

the field calculate name is "localidad"...

The "mango" part of the example confuses me a bit, because I don´t know if this is the first record of the row in my CSV, a field that the user selects or the field that "recieves" the data.

1 Like

It's the name of a unique field that calls up the data

Can I send you a similar file and help me?

@Musabahire, Sure you can send me your file and code to assist you.

Thanks. I got it solved. It was a bad .csv file format.

1 Like

Hi,
I am experiencing the same problem with 'search' and 'pulldata' functions on my spreadsheet. I have changed the csv to the recommended format on Ona but still nothing. Also, downloaded the fruits example to see if it would work but I only get the label option 'name' from the choices sheet instead of the actual fruit names in the CSV.
Please help.
REF Questionnaires Sacco 12.04.2019.xlsx (16.3 KB) sacco_details2.csv (2.2 KB)

1 Like

The function is working for text or integer type. Could you please let me know the pulldata function for single or multiple selection type?