Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9227061
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T04:58:39+00:00 2026-06-18T04:58:39+00:00

Google Spreadsheet API let’s you add rows to spreadsheets using the header names, this

  • 0

Google Spreadsheet API let’s you add rows to spreadsheets using the header names, this process is described here

The documentation however just gives an example of a simple case where the header text is made of of lowercase text (or text fitting the expression [a-z0-9]).

My application requires me to be able to set arbitrary header names for text (i.e. those that do not necessarily fit the expression above). Through much experimentation, I’ve figured out that special characters and symbols (apart from period) are generally not supported. To access a spreadsheet that uses header rows containing special characters, the header text with the special characters removed has to be used.

These transformations are not documented and I have found them mostly by trial and error.

For instance, to access a column with the header 'Foo Bar' via the API, the transformation of the header text to 'foobar' is required. Similarly, 'Foo.Bar' becomes 'foo.bar'.

Some special characters too have to be eliminated, however I keep getting corner cases in my code.

What transformations need to be made to the actual header text to access it via the API?

Also for this spreadsheet the transformation of the header text 'País' to 'país' doesn’t seem to work. I suspect it has something to do with the non-ASCII character 'í'

Any suggestions will be greatly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T04:58:40+00:00Added an answer on June 18, 2026 at 4:58 am

    You’ve got to remember when using ‘List feed’, it uses XML elements to delimit each value, taking the name of the field from Row 1 in the sheet. Thus, the limits on the name are those on XML element names. There is an article on XML.com about it here.

    As to the exact algorithm they use to transform various header-cell values into valid XML element names, I’ve never seen Google specify this (even though people have asked for clarification before now). However, one might imagine it is something like:

    foreach char in cell.value {
       if (isAllowed(char)) {
          name += char;
       }
    }
    return name;
    

    Certainly, they do tend to omit spaces (for example) instead of converting them (as would be quite reasonable) to an underscore.

    Now about characters outside of the ASCII set …

    If your í is “LATIN SMALL LETTER I WITH ACUTE”, then it’s Unicode code-point is U+00ED, and it’s written in XML-land as &#xED. As such, it’s a valid character for an XML name. From http://www.w3.org/TR/REC-xml/#NT-NameChar, it does seem to be a valid NameStartChar

     [4]    NameStartChar      ::=      ":" | [A-Z] | "_" | [a-z] | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x2FF] | [#x370-#x37D] | [#x37F-#x1FFF] | [#x200C-#x200D] | [#x2070-#x218F] | [#x2C00-#x2FEF] | [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]
     [4a]       NameChar       ::=      NameStartChar | "-" | "." | [0-9] | #xB7 | [#x0300-#x036F] | [#x203F-#x2040]
     [5]    Name       ::=      NameStartChar (NameChar)*
    

    If they do have an algorithm like the above, then &#xED ought to be ‘in’. However, I’d be paying close attention to encodings that you’re sending the Spreadsheet API, and which it is sending back to you. I wouldn’t put it past Google to have a bug in that respect.

    You could of course do an experiment: put the values in the header row of a sheet using the Google Apps user-interface, and then doing a GET of the List feed, to see how the XML actually turns out. (But I expect you have been using this in your experiments so far).

    Good luck.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using this Script in a google spreadsheet to add a new line:
I've read through the Google Spreadsheets API PHP documentation. All examples are using Zend,
Here is the following code-snippet I'm using in my Google Spreadsheet onEdit() function: else
I'm trying to access my Google spreadsheets using the GData API. I have followed
I'm trying to add a row to google spreadsheet. They give a source https://developers.google.com/google-apps/spreadsheets/#adding_a_list_row
Is there provision to create google spreadsheet using google spreadsheet api in java. I
I'm using Google Docs Spreadsheet API to keep track of a competition between some
I'm trying to get a JSON string using the Google Spreadsheets Data API. I'm
I am grabbing data from a Google spreadsheet through the Google API using cURL
Using Google Apps Script, I've made a UI for use on a Google Spreadsheet.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.