We are using a Portal system. I am currently having issues with exporting selected records to CSV from the Survey123 website. I am able to export all records to CSV and the zip file opens fine. I can export selected records to Excel. However, when I try to export selected records to CSV, I am unable to open the zip file that it creates and get the message below. Any insight?
The statements
I am able to export all records to CSV and the zip file opens fine
and
when I try to export selected records to CSV, I am unable to open the zip file that it creates
seem to conflict. Did you mistype something? I may need some clarification here.
And just to confirm, are you trying to extract the ZIP file and not just open it like a regular folder?
Not a mistype. Exporting all works, but exporting only "selected records" does not.
If I choose to export to CSV and DON'T set it to "Selected Records Only" but rather just export the entire dataset (like the image below), the zip file produced can be opened and/or extracted with no issues.
However, if I do choose "Selected Records Only" and export as CSV (see below image) the issue arises.
I get the previously shown error message when I try to open the folder to explore, and if I just choose "Extract All", I get a message saying the file is empty. This happens with every survey I've tried, and I've tried various records within each survey, all with the same results.
Exporting all works, but exporting only "selected records" does not.
Gottcha! Sorry for the confusion.
So, this is a bug. As for whether of not Esri is away, that I am not sure (I think they are, but it's been a while since I've thought about this). Either way, would be good to submit a bug report.
Basically, when you select "Selected records only", it can mess up the file extension. E.g., when you select a single record, it isn't making a ZIP file, it's actually making a CSV. You can see this for yourself if you manually change the "ZIP" file extension to "CSV".
I did a quick test to illustrate this:
test1 works as expected: I can extract the file to see contents.
test2 works as you described: ZIP file claims to be empty. However, when I change ".ZIP" to ".CSV", I can open the file normally.
EDIT: I only clued in to my mistake as I was hitting "Post". But the above scenario is true regardless of how many records you have selected. I.e., This will happen with 1 records selected, or 100 records selected. Ignore the "1 record selected" statement.
That would be temporarily viable, except I have repeat records in the survey, and as such it would ordinarily create multiple CSV files within the ZIP file, one for each table. When I change the extension, it does indeed work, but it only includes the primary table.