Pulldata issue: FormLogicError: Could not evaluate

Could you please tell me where I am making my error? I have been trying to do this for over a day now so your help will be very much appreciated!
I need to change a set of cascade select questions to choose school details by the school code using the PULLDATA function.

(I have 1,500 schools so the Cascade select will run into issues. Also, I will also need to get someone to data clease this data each month, so uploading the one data cleansed file into Media will be easier than updating the cascade select responses)

Anyway, I get this error:

  • FormLogicError: Could not evaluate: /model/instance[@id=“SchoolNamesimport”]/root/item[School Code = ‘’]/Province, message: The expression is not a legal expression. (line: undefined, character: undefined)

On the xls file, I call the school code the EMIS_Code, which I convert to a substring using EMISCode before attempting to Pull the province name. I use the School code in the CSV file. You can access the links below

Links

You can find the [XLS] here (https://1drv.ms/x/s!AhfGsxr8hYaRiblPdV_SQF7FcygP7g?e=P9Sf8X)

And the [CSV] here (https://1drv.ms/u/s!AhfGsxr8hYaRiblQa5F3PJIxE6wmzQ?e=yBiwBg)

Best,

David

I see a couple of issue in your attachment:

  • Your csv file is in xls format. You will need to change them in csv format.

  • You have used a space in the column name in the csv file which is not supported. e.g. see School Code or School name.


    As a solution, you will need to either remove the space or use the _. I have used the _ to make changes in your case as shown in the image below:

  • You will need to make changes accordingly in the survey tab of your xlsform where you have used the pulldata expression.


    The changes are here:

Revised xlsform:

Pullschoolcodes.xlsx (94.7 KB)

Revised csvfile:

SchoolNamesimport.csv (214.8 KB)

1 Like

You helped me a great deal by explaining how the following pull functionality can look up school details in a webform when the enumerator keyed in the school code. It worked very well, but now I seem to have a problem.

When I delete the old file (csv) from Media and upload the new data cleased file, I seem to be pulling data from the old file. How long does it take to update the medial files?

Best,

David

1 Like

Try clearing the cache of your browser. But please ensure that there are no pending submissions in your browser. Doing so would delete all your pending submissions.

Thank you so much for your rapid feedback.

I now have cleared my cashe, but at the same time I also uploaded an updated form and deployed both changes at the same time.

I now am getting the following message. I attach the modified form and the csv file I uploaded.

Please assist!

SchoolNamesimport.csv (382 KB)

afDeZNXYX8hpJoGpooGD6E.xlsx (18.8 KB)

Maybe try it as a fresh project and see if you can load your project successfully.

SchoolNamesimport.csv (382 KB)

afDeZNXYX8hpJoGpooGD6E.xlsx (18.8 KB)

Sorry, I think I located the problem. There was a space in one of the fields in the import file column

2 Likes