Google Spreadsheet removes underscores from field names

odk-aggregate

(Anideepa Mukerjee) #1

I am currently using Aggregate 1.6.1 to publish form submissions to a Google Spreadsheet. However, I am noticing that when this data is published, underscores in the field names are being removed in the google sheet. In the JSON export I can see participant_id, but in Google Sheets, I am seeing participantid. Is there a way to keep this consistent when I publish to Google Sheets?


(Yaw Anokwa) #2

Odd. My guess is that the Sheets API probably didn't allow underscores at some point? @Grzesiek2010, I know this is a problem with Aggregate, but in your experience with that API, does it allow underscores?


(Grzegorz Orczykowski) #3

Yes it's allowed. here is one test I filled like a week ago https://docs.google.com/spreadsheets/d/18eH-UdmC-pAsIIMuYtLLYhdr3w3lPzY6FxCylY3vaJE/edit?fbclid=IwAR2GIAbFWggZM9NFuSiC-PhzfVy6kazjuCGsS-L6R5wvVmwoFj-0sAtsvRg#gid=0 and I have underscores there.


(Guillermo) #4

Currently Aggregate has a list of unsafe characters that will be remove from column names in Google Spreadsheets, including: *, :, -, and _.


(Anideepa Mukerjee) #5

Thanks for sharing your thoughts here - I really appreciate your support. @Grzesiek2010 I am really curious how you have managed to get the underscores in your document. Perhaps I need to update to the most recent version of ODK Aggregate. It seems like my issue might be related to what @ggalmazor is mentioning. Any insights on how I can get the underscores to show up? I would hate to rename all my variables! :slight_smile:


(Grzegorz Orczykowski) #6

@anideepa
I didn't use Aggregate I just sent a form form ODK Collect to GS to check if it's possible at all.


(Anideepa Mukerjee) #7

Is this something that the ODK community would want to address? Pretty much all of my organization's surveys have underscores in the field names.


(Guillermo) #8

Hi, @anideepa!

I believe there must be a good reason to avoid underscores, but I haven't studied this. Maybe there's some hard limitation on the API Aggregate uses to push data to Google Spreadsheets, although common sense dictates that if Collect can, Aggregate should be able to use them too.

I've filed an issue to document this issue and track it down. Maybe someone can spend some time to confirm whether we need to continue replacing underscores or not.


(Anideepa Mukerjee) #9

Thanks so much @ggalmazor!