Using csv file with Survey123 web app

375
4
Jump to solution
04-08-2019 01:29 PM
Highlighted
New Contributor II

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?

Reply
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Esri Frequent Contributor

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

4 Replies
Highlighted
Esri Frequent Contributor

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.

Reply
0 Kudos
Highlighted
New Contributor II

Philip Wilson

I attached the xlsx form and csv file.

Reply
0 Kudos
Highlighted
Esri Frequent Contributor

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

Highlighted
New Contributor II

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?