Unable to auto-detect delimiting character in .csv file IE and Chrome Uisng Survey123 Browser App

2104
7
07-25-2018 08:44 AM
jonathanharte
New Contributor III

Hi Guys,

Any heads up appreciated...

I have a survey123 form and it works (so far) well in the mobile app on iOS, the same form however on the Web Browser app in IE and Chrome fails to load with an error while accessing the content of a .csv file

this is the IE file error

The error in chrome

Chrome ErrorThe auth.csv below  file is as example - it only has commas as the delimiter....   I'm using this calculate on a username Type to lookup the csv file find a user and update their Authority field.

pulldata('auth','authority','name',${username})
Auth.csv

authority,name

A,AA

B,BB

C,CC

any ideas or direction hugely appreciated

Cheers

0 Kudos
7 Replies
by Anonymous User
Not applicable

As replied in your other post:

Hi Johnathon,

 

Was the survey originally published via Connect? Can you provide a copy of the xlsx form file and also any related csv files in media folder so we can take a further look.

 

Phil.

0 Kudos
jonathanharte
New Contributor III

Hi Phil,

Thanks for taking a look ....  I have striped the survey down to just the offending bit that throws the error.

Its zipped and available  @ CSV Error

regards

Jon

0 Kudos
by Anonymous User
Not applicable

Hi Jonathon,

I had a look at your survey and csv file, and the issue appears to be caused by an extra line that exists in your auth.csv file. If you open the csv in a text editor (such as Notepad++) you will see an extra line that has no data in it (line 10). The field app appears to ignore this null line, but the web app is more sensitive to this null line: 

After I remove this line the web app loads your survey correctly without error.

Phil.

0 Kudos
DataOfficer
Occasional Contributor III

Hi @Anonymous User,
I am receiving the same error (survey published from Connect) but have gone through the solution you mention (removing null rows in Notepad++) but the error remains. Is there anything else that could be throwing up this error message? Tested in Chrome and Edge browsers.

 

Error: Initializing form...
Unable to auto-detect delimiting character; defaulted to ','
Unable to auto-detect delimiting character; defaulted to ','

0 Kudos
by Anonymous User
Not applicable

Hi @DataOfficer,

It sounds like there is still something in the CSV file that is not supported or "bad data". Can you provide a copy of the CSV file so we can take a closer look?

Regards,

Phil.

0 Kudos
DataOfficer
Occasional Contributor III

Hi @Anonymous User,
Thank you. I have sent you a private message with the zipped survey form attached.

Kind regards,
Rob

0 Kudos
by Anonymous User
Not applicable

Hi @DataOfficer ,

I took a quick look at your survey and csv files and can see the problem. Two of the csv files you are using for pulldata @ csv only have one column in them. This causes a problem, as the web app does a check to see what type of delimiter is being used (comma, semicolon, tab etc). As there is only one column there are no delimeters, hence the error.

I see that you are using the pulldata calculation as follows:

pulldata('SiteCodeList','SiteCode','SiteCode',${SiteName})

Where the SiteCode column is used twice, both the input and output. Pulldata is not really designed to work this way, there should be at least 2 columns in the csv file.

That being said, an easy way to resolve this is to duplicate the SiteCode column, call it something else, ie put a 1 on the end, and it works fine:

pulldata('SiteCodeList','SiteCode','SiteCode1',${SiteName})

You will also need to do this for the AreaCode column in the other csv too:

pulldata('AreaCodeList','AreaCode','AreaCode1',${AreaName})

Hope this helps.

Regards,

Phil.