Select to view content in your preferred language

Using csv file with Survey123 web app

3119
5
Jump to solution
04-08-2019 01:29 PM
ChelseaTabor1
Occasional Contributor

I'm pulling data from a csv file to calculate the location for a geopoint survey question.  This works fine in the mobile and desktop app, but I get this error message when I try to access the survey on the web app: 

Error: Initializing form...

  • FormLogicError: Could not evaluate: /model/instance[@id="school_locations"]/root/item[School name = '']/Lat, message: The expression is not a legal expression. (line: undefined, character: undefined)

'school_locations' is the csv file I'm trying to use and it contains a list of school names and x, y coordinates.

Is there a way to use pulldata() from a csv file in the web app?

0 Kudos
1 Solution

Accepted Solutions
by Anonymous User
Not applicable

Hi Chelsea,

Sorry for the delay in getting back to you, just had a chance to look at your survey and csv file today. The issue you are experiencing with the web app is due to the csv file column names containing a space, this is not supported. The column "School name" has a space, if you remove the space or replace with an underscore, and update your pulldata() expressions in the xslx file, the survey will load correctly in the web app once republished.

Phil.

View solution in original post

5 Replies
by Anonymous User
Not applicable

Hi Chelsea,

Yes, pulldata() does work with the web app in most cases, but you need to ensure you have set up the expressions in your xlsx form in a way that are supported on the web, and also that the csv file doesn't contain any errors or unsupported data.

Can you share your xlsx form and also the csv files from media folder so we can take a closer look?

Regards,

Phil.

ChelseaTabor1
Occasional Contributor

Philip Wilson

I attached the xlsx form and csv file.

0 Kudos
by Anonymous User
Not applicable

Hi Chelsea,

Sorry for the delay in getting back to you, just had a chance to look at your survey and csv file today. The issue you are experiencing with the web app is due to the csv file column names containing a space, this is not supported. The column "School name" has a space, if you remove the space or replace with an underscore, and update your pulldata() expressions in the xslx file, the survey will load correctly in the web app once republished.

Phil.

ChelseaTabor1
Occasional Contributor

Edit:  I forgot to change the list names in the xlsform spreadsheet to match the new names in the .csv file (replacing spaces with '_'). No more error message! 

Hey Philip,

Thanks for your help!  I'm now having another issue with the same file. I'm getting the error message "Unable to auto-detect delimiting character; defaulted to ','".

I followed your advice on this thread and removed the extra line at the end in notepad++, but I'm still getting the same error.  I also tried replacing tabs with commas, but it didn't like that either.  Anything else I can try?

by Anonymous User
Not applicable

Hi Chelsea,

Can you please provide your latest survey xlsx file and csv file from media folder so I can take a look? Please attach to this post.

We have made a lot of changes to the latest 3.12 beta which resolve many issues with CSV files and also improve the speed and reliability of loading large lists. If you want to test out the latest 3.12 beta builds, please take a look at the Early Adopter Community.

Regards,

Phil.

0 Kudos