Pulldata not working

Dear reader,

I am trying to use pull data in the following survey Form_Monoliths_with_CSV.xlsx (19.2 KB) , using the following CSV file CSV_monolith_location.csv (17.7 KB) . However I cannot get it function in ODK collect. Can someone help me with this?

Thanks in advance!

Is it working with Enketo?

I am getting this error:

when I try to preview it in KoboToolbox server.

Have you uploaded your csv file?

Yes, it is present:

If I skip CSV_monolith_location.csv for a moment, than monolith_code.csv works…

Hi,
Your form references Monolith_code.csv so kindly ensure that what you upload as CSV is Monolith_code.csv and not the CSV_monolith_location.csv as you had indicated.

Stephane

1 Like

Dear reader,

Both CSV files are needed in this survey. When both files are uploaded on the server and download the survey in ODK Collect, than the select_one for Monolith_code.csv (30.7 KB) works, but not the pulldata for CSV_monolith_location.csv (17.7 KB). If I would open it with Enkato for a preview (with both CSV files uploaded), I receive the error as described in Pulldata not working - #3 by Webex for “Monolith_code.csv”.

Dear reader,

I just have simplified the survey with only CSV_monolith_location.csv (17.7 KB) as external file and the select_one referred to the tab choices. I now can open the preview viewer online in KoboToolBox and ODK Collec, but still the pull_data function is not functioning. Do I something wrong here? I hope that you can assist me.

Thanks in advance.

@Webex, would you also mind sharing your xlsform along with the csv file?

Yes, I forget to upload it. Here it is:

Pull_data_trial.xlsx (33.9 KB).

CSV file for pull data: CSV_monolith_location.csv (19.4 KB)

Many Thanks!

@Webex, looking at your name of the choices sheet I could see that you have used some characters which is not supported by the xlsform:

image

Fix them (with normal characters) and you should be able to solve your issue.

Looking up the characters that are supported in the name are the following:

Character Name
a,b,c…z Letters; case-sensitive
0,1,2…9 Digits
- Hyphens
_ Underscores
. Periods

Is this correct?

@Webex, you got that correct. Besides, its always good to keep the variable names as simple as you can.

Hi @Webex
If you intend to use your data in other third-party applications, too, then I would strongly suggest you expand your criteria for naming to cover:

  • Each variable name must be unique.
  • The maximum variable name length is 64 characters.
  • The first character must be a letter or the character @.
  • The characters # or $ are acceptable if the data file is opened with these characters as the first position of the variable name.
  • Middle characters of the variable name can be any combination of letters, numbers, @, #, $, comma (,), period (.), or underscore (_).
  • The last character of a variable name cannot be a period (.) or underscore (_).
  • Spaces are not allowed in variable names.
  • SPSS reserved keywords cannot be used as variable names. SPSS reserved keywords are ALL, AND, BY, EQ, GE, GT, LE, LT, NE, NOT, OR, TO, and WITH.
  • Variable names can contain any mixture of uppercase and lowercase characters, and the case will be preserved in the SPSS data file.
  • Variable names cannot use reserved keywords. S1, E1, C1, NET, SUB, TN, CALC are all examples of Reserved Key Words.
  • Do not use A, C, E, F, H, I, M, R, S, or V, followed by a number (example, S3) for variable names.

Stephane

1 Like

Thanks for all your feedback!

In excelsheet choice, I renamed the variable names in digits Pull_data_trial.xlsx (38.7 KB) . I also did that for CSV_monolith_location.csv (19.4 KB) . The special characters have been removed in name. However, still the pull data is not functioning. Is there another mistake?

Sorry for the inconvenience. Thanks in advance.

@Webex, the issue is now with the format of your CSV file. I see it with the following format (i.e. separated by semicolumn):

Image 0

It should be in the following format:

But please note that the matching key for your pull data should be the same in both the xlsform as well as the CSV file. I observe that you changed the name code in the xlsform but still see some not changed in the CSV file.

The other form design issue that could possibly affect your form design is the long list of choices in your choices sheet (i.e., 1151 choices for monolith_code). This could affect the loading of your survey form while collecting your data. In such a case, I would advise you to use the external select like select_one_from_file as outlined in the support article Select One or Many From External File Question Type.

Thanks for all your feedback till now! I uploaded the wrong (old) CSV_monolith_location file. It should have been this: CSV_monolith_location.csv (15.3 KB). Sorry for the inconvenience.

In excelsheet choice, I renamed the variable names in digit Pull_data_trial.xlsx (38.7 KB). The special characters have been removed in name. However, still the pull data is not functioning in the preview. Is there another mistake? I will use the select_one_from_file again when the pulldata function is working.

Thanks in advance.

@Webex, the reason i am advising you to use the select_one_from_file is because your very first question has a choices of 1151 which will affect the loading of your survey form. Hence looking at the scenario of your form I am requesting you to use the same.

But as you insist with the pull data function, I have worked it out but by keeping only a very few choices (around 11) from the 1151 choices that you had (as if I had kept all the choices it would affect the loading of the form. So here is how it should be:

In the survey tab of your xlsform:

In the choices tab of your xlsform:

Image 2

Screenshot from the CSV file:

Data entry screen as seen in Enketo:

Reference xlsform:

Pull_data_trial.xlsx (14.3 KB)

Reference CSV file:

CSV_monolith_location.csv (15.5 KB)

1 Like

Thanks for working out! However, my goal is to pull the data out of the CSV file, in which its location is stored. After that I want to show where the chosen “monolith_code” is currently stored.

For example: I choose “Monolith_code” “20” from the select_one in the choice tab. Then I want to see where this monolith with that code (“20”) is located, using pulldata.
In Enkato should appear then: “The monolith with the code 20 is stored in: still in box.”, where the bold text is extracted data using pulldata. I matched the matching key for my pull data in both the xlsform as well as the CSV file. This should do the trick., but the requested information (“still in box”) is not appearing. Perhaps, I am using pulldata in the wrong way.

@Webex, you should be able to pull your data using the pulldata function as outlined in the image shared below:

Note: The issue was with your pull data function previously. I have fixed this here and it should work smoothly.

Data entry screen as seen in Enekto:

Reference xlsform:

Pull_data_trial.xlsx (14.3 KB)

Reference CSV file:

CSV_monolith_location.csv (15.5 KB)